WebSockets not working with IIS 8 as reverse proxy

Steps to reproduce

setup Windows Server 2012, IIS 8 with URL Rewrite 2.0 and ARR 3.0, create a rule to rewrite all the request to a linux server containing Mattermost

Expected behavior

ws:// requests working

Observed behavior

ws requests generates errors. See screenshots in my github issue

This is a problem with a recent change to web socket processing in Mattermost. Specifically,

Try reverting the change to CheckOrigin. This really should mimic what is being done for HTTP connections in the server.go file (see ServeHTTP where there is the check for Origin header).

We had the same problem recently and reverting this change fixed our web socket issues.

I’m a windows user, any chance you branch and compile it?