Open alberthdev opened 2 years ago
Unless you use -s <port>
shortcut, you are required to specify the listening IP. Typically it is 0.0.0.0
or 127.0.0.1
, but you can also specify another explicit addresses, including IPv6 ones.
Why do you state there is no way to do this? What is your Websocat command line?
The question concerns running websocat
as a client, not a server. If your client machine has multiple network interfaces, it could be that only some are allowed to access a particular host that is serving a websocket stream. Now, there is no way to connect to this stream, since websocat
always picks the default network interface.
OK, now I understand.
... option for the client to bind ...
missed that part.
For now you can use socat
-based workaround:
$ websocat -t - --ws-c-uri=wss://ws.vi-server.org/mirror --tls-domain ws.vi-server.org ws-c:ssl:cmd:'socat - tcp:ws.vi-server.org:443,bind=192.168.22.7:4567'
123
123
qwerty
qwerty
It would be useful to add an option for websocat to bind to a source IP/interface - sometimes different interfaces have specific configurations for WebSocket connectivity, and having the ability to change this on the command line would be very helpful. There's no current way to do this today, so reverting to a pipe is the only way to accomplish this at the moment.