{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/dnx/issues/3295","labels_url":"https://api.github.com/repos/aspnet/dnx/issues/3295/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/dnx/issues/3295/comments","events_url":"https://api.github.com/repos/aspnet/dnx/issues/3295/events","html_url":"https://github.com/aspnet/dnx/issues/3295","id":124675345,"number":3295,"title":"WebSockets not working when hosted on IIS","user":{"login":"jakakonda","id":4981587,"avatar_url":"https://avatars.githubusercontent.com/u/4981587?v=3","gravatar_id":"","url":"https://api.github.com/users/jakakonda","html_url":"https://github.com/jakakonda","followers_url":"https://api.github.com/users/jakakonda/followers","following_url":"https://api.github.com/users/jakakonda/following{/other_user}","gists_url":"https://api.github.com/users/jakakonda/gists{/gist_id}","starred_url":"https://api.github.com/users/jakakonda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakakonda/subscriptions","organizations_url":"https://api.github.com/users/jakakonda/orgs","repos_url":"https://api.github.com/users/jakakonda/repos","events_url":"https://api.github.com/users/jakakonda/events{/privacy}","received_events_url":"https://api.github.com/users/jakakonda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-03T22:30:44Z","updated_at":"2016-01-03T23:46:17Z","closed_at":"2016-01-03T23:46:17Z","body":"Version: ASP.NET 5 rc1-Update1\r\nSocket library: SignalR 3 rc1-final (not rc1-update1 as stated originaly)\r\n\r\n**Problem**: SignalR fallbacks to long polling when hosted on IIS, works when run directly (started from cmd dnx web command).\r\n\r\n**Tested on**: Azure website (with websockets on), my PC on IIS and directly through Kestrel (works).\r\nI have web sockets installed.\r\n\r\nSignalR log when hosted on IIS, fallbacks to long polling:\r\n\r\n    SignalR: Client subscribed to hub 'chathub'.\r\n    SignalR: Negotiating with '/signalr/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D'.\r\n    SignalR: serverSentEvents transport starting.\r\n    SignalR: Attempting to connect to SSE endpoint 'http://localhost:31650/signalr/signalr/connect?transport=serverSentEvents&c…wVlnXCY8bI7R8E&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D&tid=2'.\r\n    SignalR: serverSentEvents transport timed out when trying to connect.\r\n    SignalR: EventSource calling close().\r\n    SignalR: serverSentEvents transport failed to connect. Attempting to fall back.\r\n    SignalR: foreverFrame transport starting.\r\n    SignalR: Forever Frame is not supported by SignalR on browsers with SSE support.\r\n    SignalR: foreverFrame transport failed to connect. Attempting to fall back.\r\n    SignalR: longPolling transport starting.\r\n    SignalR: Opening long polling request to 'http://localhost:31650/signalr/signalr/connect?transport=longPolling&client…8WRrhWwVlnXCY8bI7R8E&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D'.\r\n    SignalR: Long poll complete\r\n\r\nAfter long hours of debugging, I started my website directly through dnx (no IIS or anything else) via command line using:\r\n\r\n    dnx web\r\n\r\nAnd web sockets **worked** out of the box without any problems.\r\n\r\nWhen working with sockets for node, websockets should be turned ff on IIS in order to work (link to resource [here on iis.net][1]), so I tried the same thing and got the error (occurs as soon as `webSocket` element is present in web.config):\r\n\r\n> An error occurred attempting to determine the process id of the DNX process hosting your application.\r\n\r\nMy web.config:\r\n\r\n    <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n    <configuration>\r\n        <system.webServer>\r\n            <handlers>\r\n                <add name=\"httpPlatformHandler\" path=\"*\" verb=\"*\" modules=\"httpPlatformHandler\" resourceType=\"Unspecified\" />\r\n            </handlers>\r\n            <httpPlatform processPath=\"%DNX_PATH%\" arguments=\"%DNX_ARGS%\" forwardWindowsAuthToken=\"false\" stdoutLogEnabled=\"true\" startupTimeLimit=\"3600\" />\r\n            <webSocket enabled=\"false\" /> <!-- the cause for the error above -->\r\n        </system.webServer>\r\n    </configuration>\r\n\r\nAt this point I ran out of ideas. \r\n\r\nI'd say that the problem is web sockets not being forwarded to DNX and would therefore classify it as a bug. I also added a link to a quickly (and ugly) created solution, where the problem is recreated.\r\n\r\n[Solution: WebSocketsDemo.zip](https://github.com/aspnet/Home/files/76767/WebSocketsDemo.zip)\r\n[Github repository with the demo solution source code](https://github.com/jakakonda/WebSocketsDemo)\r\n\r\n  [1]: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support"}}