I don’t know about WebSockets
, but for normal TCP sockets, you can put in 0.0.0.0
as the address on which you listen, to listen to any incoming IPv4 destination address, or ::0
to listen to any incoming connection requests addressed to any IPv4 or IPv6 address. But you can also put in the address on which the other side tries to reach the listening server, here 192.168.80.2
.
Regarding the “may already be in use” message: When listening on a TCP socket, be careful not to reopen them too quickly after closing them. After you have properly closed a TCP port, it lingers for a couple of minutes in a reserved state to make sure any stray packets from that connection have been received and aren’t able to accidentally reopen the connection or interfere with the next session.
Also, in interactive environments like the Julia REPL, it is easy to forget to properly release a resource by closing it, and then you might also get an “in use” error. Best terminate the process (quit Julia) and wait a few minutes before retrying to listen on the same port.