Open nkolban opened 8 years ago
Same problem here.
You misspelled "console" into "conosle" in line 7 of the server code, which throws an exception and what follows doesn't run.
However, I haven't figured out why the exception doesn't prompt out in the console. Anything catches the exception?
I saw the same. I added "onclose" and "onopen" logging in browser and found right after '** ws connected' is printed out, 'Websocket is closed.' is printed out. There is no any exception either at browser side or server side.
ws.onopen = function() {
console.log('****** ws connected');
ws.send('helloworld');
};
ws.onclose = function() {
console.log('Websocket is closed.');
};
I am running a browser side script which sends a message to Node.js running express hosting express-ws. I am seeing the connection form fine but when I send a message from the browser, I am not seeing any callbacks on the server side.
Here is my browser code:
and here is my server code:
I am anticipating the console.log messages in
app.ws()
to appear ... but I am not seeing any of them.