Closed erelsgl closed 11 years ago
Do you use correct server url? You should use host or ip address in url, not localhost in this case.
OK, so maybe the client in the example should contain some expression that automatically takes the correct url...
On Thu, Jan 3, 2013 at 6:58 PM, Nikita Koksharov notifications@github.comwrote:
Do you use correct server url? You should use host or ip address in url, not localhost in this case.
— Reply to this email directly or view it on GitHubhttps://github.com/mrniko/netty-socketio/issues/37#issuecomment-11851186.
"automatically takes the correct url..." Could you provide the code example for this?
Here is what I use:
var serverpath = location.protocol=='file:'? "http://localhost": location.protocol+"//"+location.host; var serverport = 8090; socket = io.connect(serverpath+":"+serverport);
On Sun, Jan 6, 2013 at 12:22 PM, Nikita Koksharov notifications@github.comwrote:
"automatically takes the correct url..." Could you provide the code example for this?
— Reply to this email directly or view it on GitHubhttps://github.com/mrniko/netty-socketio/issues/37#issuecomment-11926651.
Map server on ip or real domain, not localhost.
Following the example on the readme, I built an example application with server and client. The client code in the readme is:
This worked well on my computer, but when I tried to deploy both client and server to another machine, and tried to access the client from my machine, it didn't work, because the "connect" looked for the server on my machine (which is, for the client, the "localhost"...)
Maybe this is a documentation issue - explain how to deploy a client-server application.