cast-web-api-cli icon indicating copy to clipboard operation
cast-web-api-cli copied to clipboard

cast-web-api-cli is ignoring -H parameter and defaulting to 127.0.0.1

Open coolsaber57 opened this issue 5 years ago • 4 comments

Hello,

I'm having some trouble getting cast-web-api-cli to use my host's IP address. I also tried using the -H parameter in this way:

cast-web-api-cli start -H 192.168.2.17

as well as adding sudo to the command, but upon startup, the status shows an IP of 127.0.0.1. Not sure if I'm missing something, but I looked at the log and didn't see anything that showed why it can't use my IP.

Edit: it's possible that it's just using the local address. Is it supposed to show my host's address?

coolsaber57 avatar Nov 06 '19 16:11 coolsaber57

I am having the same issue. Would love to be able to change the address so I can use the system. And just from looking in the cast-web-api out file the 127.0.0.1 address is a default address that can not be changed even with the -H command. That needs to be fixed so that everyone can use their own IP address. can you fix please Vervallsweg

Phantomstarrh avatar Nov 10 '19 03:11 Phantomstarrh

same with the port number...

sk22 avatar May 18 '20 15:05 sk22

So, apparently, the shorthand arguments (-H, -p, etc.) don't work at all because the arguments get passed directly to the https://github.com/vervallsweg/cast-web-api/blob/master/api.js script. According to https://github.com/vervallsweg/cast-web-api/blob/master/lib/config/config.js#L16-L30, only the full argument names are accepted:

  • autoConnect
  • reconnectTimeout
  • hostname
  • port
  • debug

As it seems, we can just use the full names, and it will work:

➜  ~ cast-web-api-cli --port 3240 --hostname test start
┌───────┬──────────────┬────────┬───────────┐
│ pid   │ name         │ status │ address   │
├───────┼──────────────┼────────┼───────────┤
│ 15331 │ cast-web-api │ online │ test:3240 │
└───────┴──────────────┴────────┴───────────┘

cc @Phantomstarrh and @coolsaber57, in case you still need this

sk22 avatar May 18 '20 15:05 sk22

Hi

Found mine config.json at /usr/local/lib/node_modules/cast-web-api-cli/node_modules/cast-web-api/config/config.json

stofakiller avatar Mar 30 '21 14:03 stofakiller