Can I connect to websocket through network IP Address?

2.4k views Asked by At

I am having problem connecting to websocket through IP Address. I can connect to websocket through WAN url "ws://dev.mysite.com/WSockets/WSHttpHandler.ashx". But unable to connect with LAN url "ws://192.168.1.23/MySite/WSockets/WSHttpHandler.ashx".

Error is "Error during WebSocket handshake: Unexpected response code: 500"

"http://dev.mysite.com" and "http://192.168.1.23/MySite" are the same as our site was hosted on own server (windows server 2012) IIS.

My Question is, is it possible to connect to websocket through server IP Address? If it can, what could be my problem?

Please help. Thanks

1

There are 1 answers

1
Marcus Müller On

The point that the websocket handshake protocol is actually HTTP. So, just like your virtual HTTP domain, your web server is set up to handle requests for dev.mysite.com differently from one for other domains.

Hence, your IP address is not equivalent to your domain name in a URL -- remember: A URL specifies a unique location, which means that domain names and IP addresses need not be exchangeable.