Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Avoid "destroying upgrade" error

Avoid "destroying upgrade" error


I am trying to make a based server but whenever I connect by client to it using dojo, it shows me this error:

    debug - destroying upgrade

Here's my server code

var express = require("express");
var io = require("");
server= express.createServer();
var server_socket = io.listen(server);

    console.log("connection established");
    socket.emit("message", message);


And here's my client code

require(["dojox/socket"], function (socket)
    var args, ws = typeof WebSocket != "undefined";
    var _socket = dojox.socket(args = {
        url: ws ? "ws://localhost:8080/" : "http://localhost:8080",
        transport: function(args, message){
          args.content = message; // use URL-encoding to send the message
                                  // instead of a raw body
    websocket = dojox.socket.Reconnect(_socket);

Please help me.

Problem courtesy of: Deepak

Solution is both a server and client side library for node.js. I'm guessing Dojo's websocket client is not directly compatible with the server. I would suggest just using the client for connections, otherwise you will probably have to modify Dojo's websocket library which will probably be difficult.

Solution courtesy of: Matt Molnar


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Avoid "destroying upgrade" error


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription