vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
7.17k stars 278 forks source link

How do you get your own socket ID? #202

Closed danwdart closed 1 year ago

danwdart commented 1 year ago

How would one get one's own socket ID of for example the nc process in the websocket -> nc -l example?

Thanks

vi commented 1 year ago

What do you mean by socket ID? A port?

nc -l is typically used with -p argument to set the port number. That port number can be used in Websocat to connect to the Netcat.

$ nc -lvp 1234
Listening on 0.0.0.0 1234
$ /opt/websocat -b - tcp:127.0.0.1:1234
Connection received on localhost 52780
danwdart commented 1 year ago

Perhaps this is a sub-protocol thing in which individual clients are assigned codes to refer to each other, used in Pusher and Socket.IO. Never mind, seems out of scope.