Skip to content

open websocket on same path as page #149

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

Merged
merged 1 commit into from
Mar 9, 2019

Conversation

dbushong
Copy link
Contributor

@dbushong dbushong commented Mar 8, 2019

This is the critical piece to let you serve code-server proxied under a
path. Otherwise if you proxy e.g. /editor/ thru to
http://localhost:8000, everything works fine except the websocket
connection is still opened to /

This is the critical piece to let you serve code-server proxied under a
path.  Otherwise if you proxy e.g. `/editor/` thru to
`http://localhost:8000`, everything works fine except the websocket
connection is still opened to `/`
@dbushong
Copy link
Contributor Author

dbushong commented Mar 8, 2019

The app with this works minimally when proxied. There are some 404ing assets, which I'm not immediately sure how to fix:

  • /lib/vscode/src/vs/workbench/parts/webview/electron-browser/webview.html
  • /resource/home/travis/build/codercom/code-server/packages/server/build/extensions/theme-seti/icons/seti.woff
  • /__webpack_hmr
  • /lib/vscode/src/vs/workbench/browser/parts/editor/media/split-editor-horizontal-inverse.svg
  • /lib/vscode/src/vs/workbench/parts/webview/electron-browser/webview-pre.js
  • /lib/vscode/src/vs/platform/extensionManagement/node/media/defaultIcon.png

Basically all of those should be /whatever/path/page/is/on/<their path above>/...., I assume the fix is similar to this websocket url fix.

@kylecarbs
Copy link
Member

Did these assets 404 prior to the WebSocket fix?

@dbushong
Copy link
Contributor Author

dbushong commented Mar 8, 2019

The only one I can confirm is __webpack_hmr - the others don't even load without the websocket connecting.

@avelino
Copy link
Contributor

avelino commented Mar 8, 2019

This issue fixed:
#141

@kylecarbs kylecarbs merged commit d7a66e4 into coder:master Mar 9, 2019
@kylecarbs kylecarbs mentioned this pull request Mar 9, 2019
@dbushong dbushong deleted the feature/master/proxy-path branch March 10, 2019 04:28
andreimc added a commit to devonlineco/code-server that referenced this pull request Mar 11, 2019
* upstream/master: (35 commits)
  Dockerfile: use relative path instead of $PWD for CMD
  Update docker oneliner and fix clone task
  Clone exact vscode release branch when build task (coder#167)
  Add -t flag to docker example (coder#181)
  Reverts parts of my last PR (coder#177)
  Fix build and Dockerfile issues (coder#176)
  Add nginx reverse proxy guide for selfhosted
  Use a timing-safe equality check for passwords (coder#133)
  Open websocket on same path as page (coder#149)
  Adhere to XDG base directory spec for dataDir and logDir (coder#156)
  Improve github issue template (coder#162)
  Fix typo: environemnt -> environment (coder#159)
  Add back web class
  Move upx compression behind an env flag
  ci: enable travis npm cache (coder#110)
  Improve .dockerignore (coder#111)
  Feature/1.32.0 update (coder#117)
  Update grammar on README (coder#139)
  inital -> initial (coder#135)
  Handle arch in dockerfile and add PR template (coder#109)
  ...
code-asher pushed a commit that referenced this pull request Jun 19, 2019
This is the critical piece to let you serve code-server proxied under a
path.  Otherwise if you proxy e.g. `/editor/` thru to
`http://localhost:8000`, everything works fine except the websocket
connection is still opened to `/`
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.

3 participants