html websocket is 127.0.0.1 when connecting from remote computer (RPI3)
MetallianFR68 opened this issue · 3 comments
I just installed cam2ip on my RPI B3+ and it works well.
My RPI has static IP 192.168.0.60
MJPEG works perfectly when I connect here : http://192.168.0.60:56000/mjpeg
But HTML doesn't work when connecting to http://192.168.0.60:56000/html
I'm connecting from a remote computer on the network
But the javascript code wants to open websocket 127.0.0.1
"WebSocket connection to 'ws://127.0.0.1:56000/socket' failed: Error in connection establishment:net::ERR_CONNECTION_REFUSED"
It should open ws://192.168.0.60:56000
Am I doing something wrong ?
If you want to bind to specific ip/port use the -bind
option, if not given it will default to localhost.
Hmm, I tried to use 0.0.0.0 as default, if -bind-addr is not specified, but it doesn't work on all browsers.