Find a topic

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Aug 2017 08:36 PM by  Declan Ward
Push notification with WebSockets
 0 Replies
You are not authorized to post a reply.
Author Messages
Declan Ward

New Member

New Member


Association Member

14 Aug 2017 08:36 PM
    I am attempting to implement WebSockets in a DNN Module.

    To see how WebSockets work I built a MVC application which works just fine.

    MVC Application
    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


    responds from:
    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()
    if (HttpContext.Current.IsWebSocketRequest)
    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!
    You are not authorized to post a reply.

    Hosting liberally provided by