Hide menu Last updated: Feb 22 2016

WebSocket support in the CMS user interface

[New in Episerver UI 9.4.0]

To improve the CMS user interface experience when collaborating around content, a WebSocket connection notifies the user interface about available updates so that changes in projects are updated instantly in the project overview without any explicit refresh. Only information about updated projects and project items are shown instantly.

Note: Known limitation: WebSocket support must be installed and enabled on the web server. Without WebSocket support, you must manually refresh the user interface for updated comments and project items to show.

A WebSocket connection is a full-duplex communication channel over TCP from the browser client to the web server, and was standardized by IETF as [RFC6445](https://tools.ietf.org/html/rfc6455) in 2011. It is available in all modern browsers, but may still pose a problem with firewalls and reverse proxies not yet implementing the standard.

Make sure server can handle WebSocket connection

If you have not installed WebSockets already, you need to install WebSockets on a Windows machine by following these instructions.

After that make sure that the HttpRuntime is targeting version 4.5; if not, the server is unable to initiate the WebSocket connection. You do this by putting the following settings in the web.config file.

<system.web>
    <httpRuntime targetFramework="4.5" />
</system.web>

<httpRuntime targetFramework="4.5" /> is a shortcut that allows the ASP.NET runtime to infer a wide array of configuration settings. One of those settings is ValidationSettings. You also need to place the following code in web.config file to have correct ValidationSettings value.

<appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>

These settings allow the server side to accept and serve WebSocket connections.

A WebSocket connection is initiated as a plain HTTP GET request with a `Connection:Upgrade` header, whereby the server responds with a similar upgrade reply. If a non-supporting proxy server or firewall receives this request, it most likely drops the headers and returns the `200 OK` response from the server, causing the client to close the connection. If this is the case; try bypassing the middle-tier and connect to the web server directly to make sure it is properly configured. When you are sure that the web server is not the problem, start looking into the proxy server configuration and see whether it supports web sockets.

As a last resort, you can disable the WebSocket support on the web server by adding the following configuration to the appSettings section in web.config. By doing this, the CMS edit user interface does not establish a WebSocket connection to the server, and the end user has a degraded experience.

<appSettings>
    <add key="Epi.WebSockets.Enabled" value="false" />
</appSettings>

Comments

Why ValidationSettings:UnobtrusiveValidationMode should be disabled to enable WebSockets? I do not see any relation.

Setting ValidationSettings:UnobtrusiveValidationMode to None disables client-side unobtrusive validation using built-in Html.Form etc, doesn't it?