-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
[SUGGESTION] Add feature to keep instance running if the webpage is still open #402
Comments
Ah wrong label sorry, it won't let me change it now |
I don't think it's possible to inject a websocket connection inside your webpage. However, we could create a specific endpoint on Sablier directly, which you could connect from your website. But this require being able to alter the source code of the webpage. You could do that, or we could also consider a browser extension. What do you think? |
The issue is I don't have access to alter the source. (Well I do, but it's a container) If Sablier stops acting as a proxy then I can see the issue; however my understanding is that Trafik proxies to Sablier which proxies to the container Essentially, the existing HTTP server that you use as the landing page, it just needs to pass the headers to upgrade to a WS connection (there may be a helper function in Go); at this point nothing else changes, except that the connection will stay alive and you can just listen to the socket closing |
I need to try this out, this seems "hacky" but that could work I guess? If you can provide some kind of proof of concept that'd be amazing. No need to connect with Sablier whatsoever, just a simple auto upgrade to websocket or something else. To be fair, I doubt this is technically doable ? How one request would upgrade to websocket but still serve content ? Without an websocket client on the client side, the websocket switching protocol response will just be dropped |
Could we please get an option to not start the countdown until after the user has closed the tab?
I have a sandbox container running coder/code-server to allow remote development. With a 1m timeout, the container gets destroyed as I didn't navigate to another page.
I propose you to do this using WebSockets, as the close() event would fire once the tab is closed, as the websocket connection is destroyed.
So, the config option I propose is
openTabsMaintainSession: true
With this set to true, when you connect to Sablier, it upgrades your connection to a socket connection; it pauses the countdown timer, and unpauses the timer once the close() event fires.
I'm not proficient in GoLang so I can't do a PR for this myself I'm sorry!
The text was updated successfully, but these errors were encountered: