Websockify error - Address already in use
I'm running a script called quarqd which dumps it's XML data to port 8168. I run this in terminal on OSX Lion. I can connect to the port using netcat and watch the data stream in.
I need to take this data and dump it to a websocket though for manipulation and display in a local only webpage. So I tried doing this with Websockify.
$ websockify 8168 localhost:8169
I run the command and I get a bit of confirming code like it's setting up but then it breaks out with this error message.
[Errno 48] Address already in use
The downer here is that I'm intending for that socket to be in use. It's that data that I want to dump over to the websocket. I've tried multiple port numbers for the second argument just to be sure it wasn't that port being tied up, but still no luck. Isn't Websockify made for this very use? TCP socket to Websocket? If so, how do I get it to run correctly? FYI, I'm a bit new to Python.
The second address is the target. The first address/port is where you connect using websocket and that's the one that needs to be a free/open port. In other words, you want your addresses reversed:
websockify 8169 localhost:8168
Then tell your browser to connect to host:8169. This will cause websockify to connect to localhost:8168 and bridge the traffic to 8169 which is what the the browser is connected to.
In other words:
browser -> (websockets) -> websockify port 8169 -> (tcp) -> server port localhost:8168
Disclaimer: I made websockify.