Closed ptarjan closed 9 years ago
how did you go with this? Can you console.log(self)
and console.log(self.ws)
and post the output here?
I figured this out. The Browser WebSocket Class and the NodeJS WebSocket Class do NOT have the same API. You are relying on the fact that this is NodeJS and not being run using browserify.
I put in this code, and your library works. Maybe you should include it yourself if the on
method doesn't exist?
WebSocket.prototype.on = function(event, callback) {
this['on' + event] = function(message) {
callback(message.data);
};
};
I'm getting
If I put a debugger, I see that
self.ws
has aonClose
and anonOpen
, etc, but noon
. Is there a version mismatch somewhere? When I installed I ended up with version 0.8.0 ofws
.