Address
304 North Cardinal St.
Dorchester Center, MA 02124
Work Hours
Monday to Friday: 7AM - 7PM
Weekend: 10AM - 5PM
Easily enable support for the WebSocket protocol on Windows Server IIS by installing the Web-WebSockets feature using PowerShell. Learn how to install WebSocket Protocol support in Windows Server IIS 8.0.
Easily enable support for the WebSocket protocol on Windows Server IIS by installing the Web-WebSockets feature using PowerShell.
One of the limitations to HTTP is that it was designed as a one-directional method of communication. However, many modern web-based applications require more real-time, two-way communications in order to function optimally. With the release of Windows Server 2012 and Windows 8, Internet Information Services (IIS) 8.0 has added support for the WebSocket Protocol.
The WebSocket Protocol is an open standard that is defined in RFC 6455, and developers can use this functionality to create applications that implement two-way communications over the Internet between a client and server.
You can use the following PowerShell command to easily install the Web-WebSockets feature in IIS:
Install-WindowsFeature -name Web-WebSockets
A second way to install the Web-WebSockets feature in IIS, is to use the Deployment Image Servicing and Management (DISM) command. Enable the Web-WebSockets feature:
%SystemRoot%\system32\dism.exe /online /enable-feature /featurename:IIS-WebSockets
Or use PowerShell’s Enable-WindowsOptionalFeature
cmdlet as a third option:
Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName IIS-Websockets
You can read how to install IIS on Windows 11 in my post Install IIS in Windows 11 using PowerShell. Don’t forget to enable WebSocket support for your website.
In addition, it is recommended to install and enable Windows Communication Foundation (WCF) web services in IIS 8, with .NET 4.5.
To do so you need to install the HTTP Activation feature:
Install-WindowsFeature -name NET-HTTP-Activation
Install-WindowsFeature -name NET-WCF-HTTP-Activation45
Instead of PowerShell, you can use DISM for this too (of course 😉 ).
You may have forgotten to enable multipleSiteBindingsEnabled in your web.config
file.
You’ll need to add a *.svc handler if the IIS web server feature installation failed to do so.
You’ve just learned how to install WebSocket Protocol support in Windows Server IIS 8.0 using PowerShell’s Install-WindowsFeature
.