I am attempting to implement WebSockets in a DNN Module.
To see how WebSockets work I built a MVC application which works just fine.
By using an addin to Chrome, I can see that a socket is successfully opened:
I then converted to IIS, rather than localhost, and after installing the WebSocket protocol in IIS this also works:
Because I successfully opened the socket in the MVC application I thought replacing the host name + module name would work:
Unfortunately not. I get an error:
'ws://gg-dev2/api/dwsWebSocketTest/Websocket' failed: Error during WebSocket handshake: Unexpected response code: 404 http://gg-dev2/API/dwsWeb...tTest/WebSocket/test
public HttpResponseMessage HelloWorld()
return Request.CreateResponse(HttpStatusCode.OK, "Hello from WebSocketController!");
and I can trap this in the debugger. This suggess my url is correct.
Testing the socket does not get to my code. I have tried with & without the decoration:
//[DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Anonymous)]
public HttpResponseMessage Get()
var commentHandler = new CommentSocketHandler();
return new HttpResponseMessage(HttpStatusCode.SwitchingProtocols);
Do I need to do something in DNN to get this to work, or am I missing something obvious?
All suggestions welcomed!