How to install the Web-WebSockets feature in IIS using PowerShell

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.

Home » How to install the Web-WebSockets feature in IIS using PowerShell

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.

IIS 8.0 WebSocket Protocol Support

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.

Enable .NET 4.5 Windows Communication Foundation (WCF) in IIS 8

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 😉 ).

Frequently Asked Questions

I have installed the IIS feature NET-HTTP-Activation and NET-WCF-HTTP-Activation45, but my ASP.NET webapplication throws the following error: “Server Error in MultipleBindings Application, This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.”

You may have forgotten to enable multipleSiteBindingsEnabled in your web.config file.

My freaking .NET web service returns a TypeLoadException like: “TypeLoadException: Could not load type ‘System.ServiceModel.Activation. HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′”

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.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Share via
Copy link