-
Notifications
You must be signed in to change notification settings - Fork 5.9k
fix: wrap socket in proxy before passing to vscode #4840
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
Conversation
✨ Coder.com for PR #4840 deployed! It will be updated on every commit.
|
Codecov Report
@@ Coverage Diff @@
## main #4840 +/- ##
==========================================
+ Coverage 69.72% 69.73% +0.01%
==========================================
Files 29 29
Lines 1645 1649 +4
Branches 363 363
==========================================
+ Hits 1147 1150 +3
- Misses 424 425 +1
Partials 74 74
Continue to review full report at Codecov.
|
6aafd04
to
af2792f
Compare
af2792f
to
3580cf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉 🎉
Re-run e2e tests after merging: #4857 |
Need to add back in |
db72d83
to
94149b5
Compare
I believe the e2e tests are failing because we need to update VS Code (waiting on another PR) |
94149b5
to
6049dd3
Compare
@ericzhucode what is the output when you run |
Sorry I forgot to update this comment. After cherry-pick this commit and build code server again, it's working perfectly now and no disconnection occurred. |
@ericzhucode hooray!!! Really happy it's working. Thank you for confirming! 🎉 |
* chore: add ipc hook to e2e script * refactor: allow codeServerArgs in e2e tests * feat: add --cert e2e extension test * fix: wrap websocket in proxy * fixup: remvoe ignoreHTTPSErrors * fixup: make codeServerArgs readonly * fixup! add back ignoreHTTPSErrors
Summary
This PR fixes a regression introduced in 4.0.1. Previously in 3.12.0, using the
--cert
flag allowed you to use code-server locally over HTTPS. The regression broke that functionality causing theExtensionHost
to repeatedly reconnect and fail. We fixed this by wrapping the socket in ourSocketProxyProvider
before passing back to VS Code. This is because TLSSockets cannot be passed to child processes.Changes
args
extension.test.ts
with--cert
flagreq.ws
instead ofreq.socket
req.ws
inSocketProxyProvider
and pass inhandleUpgrade
Context
We didn't have a test for this feature so the regression was introduced in 4.0.1. We've now added a new e2e test which uses the
--cert
flag and attempts to use an extension. This will only work if theExtensionHost
is working properly. Therefore, this will prevent new regressions.After adding the new e2e test, we tested it against the 3.12.0 build and it worked as expected:
extension-proof.mp4
Here is that same test passing against code-server using a local dev build with the regression fixed:
4.0.2-proof.mp4
We also took extensive notes and whiteboarded the flow here to help us arrive at the solution.
Fixes #4693