WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@EhabY
Copy link
Collaborator

@EhabY EhabY commented Dec 29, 2025

Summary

  • WebSockets now automatically reconnect when proxy, TLS, or header settings change
  • Previously users had to reload the window for these changes to take effect (or trigger a WS reconnect)
  • Extracted reusable watchConfigurationChanges utility from remote.ts

Settings that trigger reconnection

  • coder.headerCommand
  • coder.insecure
  • coder.tlsCertFile, coder.tlsKeyFile, coder.tlsCaFile, coder.tlsAltHost
  • http.proxy, coder.proxyBypass

Closes #691

@EhabY EhabY force-pushed the reconnect-websockets-on-settings-change branch from a60e95a to ee02756 Compare December 30, 2025 09:00
WebSockets now automatically reconnect when relevant settings change
(proxy, TLS, header command, etc.). Previously, only credential changes
(host, and token) triggered reconnection.
@EhabY EhabY force-pushed the reconnect-websockets-on-settings-change branch from ee02756 to 31625da Compare December 30, 2025 10:15
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly looks good to me. I do wonder though, if we have a working web socket connection do we really need to reconnect? Could make sense for the proxy settings, if you want to switch to a new proxy or something. For the rest though seems like if we have a working web socket, might as well keep using it.

@code-asher
Copy link
Member

code-asher commented Dec 30, 2025

Ah but maybe the "reconnect" wording is throwing me off, if the web socket is currently failing to connect, makes sense to force a retry once the settings have changed. But does seem like if the web socket is working we could leave it. Probably not worth the effort though, the settings probably change infrequently.

@EhabY
Copy link
Collaborator Author

EhabY commented Dec 30, 2025

But does seem like if the web socket is working we could leave it. Probably not worth the effort though, the settings probably change infrequently.

My thoughts as well, we could in theory just do reconnectIfDisconnected where we check the socket is valid but not sure if it makes sense (also not sure if we can get stuck in a state where the socket is broken without erroring - somehow -)

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

Successfully merging this pull request may close these issues.

Trigger a WebSocket reconnect when changing mTLS settings

2 participants