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

feat: introduce --abs-proxy-base-path that allows app proxying while code-server is not server at the root #6958

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

rafaelnferreira
Copy link
Contributor

What it is

  • Allows proxy traffic to be properly routed when code-server is served under a path.

How

  • Introduces a new switch abs-proxy-base-path.
  • When specified, absproxy requests will be forwarded using the value as prefix

Example

  • Code server is hosted at: my-codeserver.com/user/123
  • React App is started at port 8080 under PUBLIC_PATH /user/123
  • abs-proxy-base-path set to /user/123
  • A GET request to my-codeserver.com/user/123/absproxy/8080/app will properly reach the app.

Fixes #6770

@rafaelnferreira rafaelnferreira requested a review from a team as a code owner August 25, 2024 11: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.

This is great thank you for implementing!

@code-asher code-asher enabled auto-merge (squash) August 26, 2024 19:24
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@39ce82a). Learn more about missing BASE report.
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6958   +/-   ##
=======================================
  Coverage        ?   72.63%           
=======================================
  Files           ?       31           
  Lines           ?     1904           
  Branches        ?      412           
=======================================
  Hits            ?     1383           
  Misses          ?      441           
  Partials        ?       80           
Files Coverage Δ
src/node/cli.ts 90.90% <ø> (ø)
src/node/routes/index.ts 76.41% <ø> (ø)
src/node/routes/pathProxy.ts 82.14% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39ce82a...71d10b1. Read the comment docs.

@code-asher
Copy link
Member

code-asher commented Aug 26, 2024

Looks like our formatter is being a bit weird, let me fix it real quick

Edit: actually not sure what is going on, CI seems to format a little differently compared to local...I will undo the indentation for now and figure it out later.

Not sure why it keeps trying to indent the options though, in CI it
wants it flat.  Going to keep it flat for now until we figure it out.
@code-asher code-asher merged commit 4a70389 into coder:main Aug 26, 2024
10 checks passed
@rafaelnferreira rafaelnferreira deleted the absproxy-path branch September 1, 2024 08:45
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.

Add --base-path flag for use with absolute proxy
2 participants