Home > Blockchain >  Web Socket: IIS WebSocket Protocol feature need to be enabled for Socket.io?
Web Socket: IIS WebSocket Protocol feature need to be enabled for Socket.io?

Time:03-08

For one of my application, I have implemented Web socket using socket.io and hosted in IIS. Currently socket connection helping to provide two way connection between client (React) and server (node.js).

As I mentioned, I have hosted my application in IIS. I have few doubts regarding Turn Windows features on or off -> Internet Information services -> World wide Web Services -> Application Development Features -> WebSocket Protocol. I have tested my application without enabling this feature, its working fine, but I would like to confirm below stuffs. WebSocket Protocol

  1. Do I really need to enable WebSocket protocol feature to make websocket work in my application? If so, how now it is working fine without enabling (I haven't do performance and stress testing, I may face issue on this).

  2. What if I not enabling this feature? in short what is the actual use of this feature?

It would be helpful if anyone answer the above questions. Thanks in advance.

CodePudding user response:

WebSocket as part of the HTTP stack requires a bunch of things to be ready on Windows (across multiple components), so hope this answer helps a little.

  • HTTP.sys, a driver deep down in Windows OS, is upgraded to support the necessary packet communication required by the protocol.
  • The IIS WebSocket module, an IIS extension which many other Microsoft frameworks (like SignalR) depend on.

So WebSocket support is by default on in HTTP.sys, and you don't need the IIS module if your framework (socket.io) has no dependency there.

Note that the "Summary" section provides several useful links,

https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support#summary

and the same article also reveals that IIS WebSocket module has conflicts with socket.io.

  • Related