Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to disable auto disconnect #359

Open
lixiang29netease opened this issue Sep 5, 2023 · 5 comments
Open

how to disable auto disconnect #359

lixiang29netease opened this issue Sep 5, 2023 · 5 comments

Comments

@lixiang29netease
Copy link

I have deploy a webssh service in k8s,and I use ingress-nginx to proxy it.
when I open a ssh connection to one pod via webssh, and I do nothing on this page. A few minutes later, webssh will logout and back to login page automatically, which I dont want.
Is there any method to hold this connection?Although i did nothing after open connection page.

I have watch the webssh log, it is:
[I 230905 07:45:33 worker:123] Closing worker IIwr5-c37cHmc88K42qTjQc5UTcfwojB9XBJYSdxZw8 with reason: client disconnected
[I 230905 07:45:33 worker:131] Connection to 10.167.15.220:22 lost

@820101274
Copy link

同问,如何解决自动断开的问题~
@huashengdun

@lixiang29netease
Copy link
Author

can it works by adding interval heartbeat from client?

@lixiang29netease
Copy link
Author

i found a solution and it works well.
in file main.js, i add a interval heartbeat like this:
setInterval(() => {
sock.send(JSON.stringify({'heartbeat': 'ping'}));
}, 60000);

@820101274
Copy link

i found a solution and it works well. in file main.js, i add a interval heartbeat like this: setInterval(() => { sock.send(JSON.stringify({'heartbeat': 'ping'})); }, 60000);

I tried it and it still goes like that

@x2y2
Copy link

x2y2 commented Nov 6, 2023

set wpintvl greater than 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants