Skip to content

Disconnect WebSocket if user is idle for 1 hour #1297

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

Closed
nhooyr opened this issue Jan 27, 2020 · 8 comments
Closed

Disconnect WebSocket if user is idle for 1 hour #1297

nhooyr opened this issue Jan 27, 2020 · 8 comments
Assignees
Labels
enhancement Some improvement that isn't a feature

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Jan 27, 2020

See #1274 (comment)

@nhooyr nhooyr added the enhancement Some improvement that isn't a feature label Jan 27, 2020
@antofthy
Copy link

antofthy commented Feb 6, 2020

Depends on what you mean by idle.

In our case idle is when the web socket is NOT being used, in which can we want to terminate the containing docker environment. We do this by watching the "heartbeat" file.
#1050

We do not want to disconnect if the user keeps his browser open to code-server, though I can see that some users/developers would like that.

Also what do you mean by disconnect? Logout the user so they need to re-type the password? Terminate Code-server?

@nhooyr
Copy link
Contributor Author

nhooyr commented Feb 6, 2020

So this is independent of the heartbeat file. I think if someone leaves code-server open on their desktop for like 6 hours but does nothing, we shouldn't keep the WebSocket up, we should just disconnect the WebSocket.

Disconnect just means drop the WebSocket.

@coadler
Copy link
Contributor

coadler commented Feb 6, 2020

Maybe we could make this an option?

--idle-timeout=1h

@antofthy
Copy link

antofthy commented Feb 7, 2020

As long as it is clear in the doc's.

Mind you I don't think the "heartbeat" file is documented either, except here in git "issues".
Hmmm... Nope, the only mention of heartbeat in the git download is in the "server.ts" code.

Looks like a case of "Use the source, Luke!" :-)

@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 17, 2020

Yea we really need to document that.

@nhooyr nhooyr self-assigned this Apr 17, 2020
@antofthy
Copy link

antofthy commented Apr 17, 2020

Even if the option was provided, it is more likely we will continue to use the heartbeat file, as we monitor it from outside the docker instance, and shutdown the docker instance completely when we reach our time out. That is we need to do more than shutdown the web socket on timeout.

So just the heartbeat file needs to be documented. Where ever that is done.

@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 17, 2020

Yea I agree, the websocket will disconnect naturally anyway since their computer will just go to sleep if they leave it on for an excessive amount of time.

@nhooyr
Copy link
Contributor Author

nhooyr commented Jun 3, 2020

@nhooyr nhooyr closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

3 participants