0

From my understanding, WebSockets has been designed to traverse firewalls and proxies. Indeed, after an handshake between the client and the server, the communication protocol will change from HTTP to WS but it will still communicate on the port used to establish the handshake. (See websocket.org).

In other words, if a client can do an HTTP request on a given port, he will also be able to do WS on the same port.

However, according to XSockets configuration documentation, the port used for WS communications isn't the same as the HTTP port. Unlike a regular WS connection, a NAT on the firewall seems to be required to allow communication between the XSockets server and the client.

Is there a way to configure an XSockets server to re-use the HTTP port used for the handshake (port 80) without creating conflicts with the existing web applications hosted on the same web server (IIS)?

The_Black_Smurf
  • 5,178
  • 14
  • 52
  • 78

1 Answers1

1

You are right. But, the application listening on the web port, should be able of understanding WebSocket protocol in order to do the handshake, and that is not the case of IIS < 8.

If you want to have your WebSocket running on the same port than your web application, you need IIS 8 (included in Windows >= 8 and >= 2012).

As far as I know XSocket allows you to use IIS8 as hosting environment: http://xsockets.net/docs/hosting#using-iis8

But if you have IIS < 8 , then it is not possible. It is not a XSocket limitation, it is a IIS limitation.

vtortola
  • 34,709
  • 29
  • 161
  • 263
  • Thanks for the details of your answer. I didn't mention it but I decided to use XSockets (vs SignalR or native support in .NET 4.5) mainly because I didn't want to work with Windows 8. – The_Black_Smurf Jun 05 '14 at 02:19
  • That being said, even if XSockets can't switch to the handshake port, I still think it's one of those programming gem that deserves way more attention. – The_Black_Smurf Jun 05 '14 at 02:28
  • Yeah, it is a neat component. If you ever interested in just the WebSocket connection because for example you already have your own event architecture, take a look to WebSocketListener: vtortola.github.io/WebSocketListener (disclaimer: I did it) – vtortola Jun 05 '14 at 09:11