New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

The forum below will remain in read only mode.

Yay... Take Me to the Community!

Push notification with WebSockets

You are not authorized to post a reply.
Declan Ward
New Member
New Member
Association Member
    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