Reputation: 1377
I'm trying to build a node.js chat web-app. Here is the code that I'm using. Running this app, only works on localhost.
How do I to make it work on Intranet, please ?
EDIT : On Intranet, to test this. I type on the web browser http://IPaddressHostChat:8080
.
The web browser gets the web page, but, the exchanged messages are not displayed among computers.
How to fix this please?
Thanks a lot!
Upvotes: 0
Views: 719
Reputation: 10092
The problem is most likely that you refer to a specific host and port in your client's code. Use just io.connect()
dropping host and port in the html file. See the following for exactly the same issue: 404 on Socket.io connect
Upvotes: 1
Reputation: 3803
First, you need to know your host IP address. You can do that by opening cmd and type ipconfig
Then, you should be able to see your own IP address, usually is 192.168.1.**
Use that IP address for your socket connection.
Make sure your client is on the same intranet as yours. You can check your client connection with your server connection by typing
ping <host ip address>
or if it doesnt give you a ping or request time out, you may check by typing this in cmd
tracert <host ip address>
Using this command, you will be able to track which part is stopping your client from connecting to your server! Usually it might be due to some firewall settings!
I have no problem deploying my websocket using intranet!
Upvotes: 0