Skip to content


Subversion checkout URL

You can clone with
Download ZIP


reconnect/sockjs #4

Raynos opened this Issue · 8 comments

3 participants


reconnect/shoe is pretty cool but can't be used on the server.

I'll make a pull request that adds sockjs.js for doing reconnect on the server with sockJS


Is there an example of this working? I have tried modifying example/shoe/client.js to use require('../../shoe') and removed the dom noise but I get this error on the server when I try to connect the client:

TypeError: Cannot read property 'request' of undefined
    at /home/jeremy/reconnect/examples/shoe/server.js:14:40
    at Server.handler (/home/jeremy/reconnect/node_modules/shoe/index.js:22:9)
    at Server.EventEmitter.emit (events.js:95:17)
    at App.emit (/home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/lib/sockjs.js:182:27)
    at new RawWebsocketSessionReceiver (/home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/lib/trans-websocket.js:155:14)
    at ws.onopen (/home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/lib/trans-websocket.js:52:16)
    at EventTarget.dispatchEvent (/home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js:36:30)
    at API._open (/home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/node_modules/faye-websocket/lib/faye/websocket/api.js:22:10)
    at /home/jeremy/reconnect/node_modules/shoe/node_modules/sockjs/node_modules/faye-websocket/lib/faye/websocket.js:50:38
    at process._tickCallback (node.js:415:13)

I'd be happy to build it out into a failing example that we can merge once fixed!


@jez0990 I always use reconnect/inject manually. I use it with shoe or People also say good things about


@jez0990 a failing example would be great! will merge!


@Raynos thanks for the pointers, I will check them out :)

@dominictarr here's the example:

Simply do npm start and separately node node-client.js

(your original client.js needs updating to use ../../shoe as well)



@Raynos is the supposed to be able to connect to a shoe server? I'm having no luck :(

I also tried using websocket-stream...

Any pointers on how I might fix this issue though? I really want to figure this out.


@jez0990 it has to connect to an server.


@jez0990 the only problem was in a console.log if you commented that line it worked.
I've fixed it now. 0e04c52


Thanks!! Very much appreciated. I did eventually discover that the console.log itself was a culprit but didn't know if the implications were wider.

@dominictarr dominictarr closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.