I am currently working with the Socket.IO fro nodejs to share some real time information between a server and some clients. The clients should only communicate with the server, not with each other.
On windows everything is fine and I can share information, but as it put things onto a linux vps, I have got the problem that he started everything on a ipv6 socket which made it difficult for me to connect with the clientside browser library from socket.io
I start the server like this:
io = require('socket.io').listen(3000);
which worked fine, and I could connect. Now on the linux vps I tried to prevent ipv6 by using a ipv4 adress like this
io = require('socket.io').listen(3000, '0.0.0.0');
but that did not work, not on linux and not on Windows. He does not bind the socket to the ip I want it unless I use the http server like this:
http = require('http').createServer().listen(3000, '0.0.0.0');
io = require('socket.io').listen(http);
Now my question is, do I have to use the http server to solve the problem of binding the socket to the right local ip and port or is there any other solution? And does socketio start a http server in the background in case of my first line of code, as it is a web socket, or does socketio work without the http server?