Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

socket io Websocket Disconnected Node js

I am actually facing an issue here. I am having a login page From there I am going to another page. From there I am getting my socket disconnected.

What i am trying to do is

In my server side app.js

app.post('/login', urlencodedParser, function(req, res) {
req.session.username = req.body.usr;
req.session.password = req.body.pass; 
req.session.password = 380; 
authenticatAPI.logIn(req, res);
});

From here then to authenticate js(server side)

getUserName = req.body.usr;
getPassword = req.body.pass;
req.session.username = getUserName;
req.session.password = getPassword;
res.send({url:"screen1.html",id:100,usr:getUserName});

From here to client side

var socket = io.connect('http://localhost:8080');

When i reach here Again it goes for app.js and goes inside the io.on("connection") function ,here I am getting an error when i debug using node inspect.

"Remote debugging stopped Websocket closed reattach new target" What should i do here....?

like image 888
Mohammed Safeer Avatar asked Mar 18 '26 20:03

Mohammed Safeer


1 Answers

I'm going to bet that you have node inspect set to break on caught exceptions. Try unchecking "Pause On Caught Exceptions" near the right hand side of the debugger.

enter image description here

Otherwise, you are likely using a 3rd party library that is using socket.io that is throwing this error.

like image 164
KJ Price Avatar answered Mar 20 '26 09:03

KJ Price



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!