Skip to content

Add a way to proxy/tunnel ports or view files through code-server #512

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

Closed
geiseri opened this issue Apr 17, 2019 · 6 comments
Closed

Add a way to proxy/tunnel ports or view files through code-server #512

geiseri opened this issue Apr 17, 2019 · 6 comments
Labels
enhancement Some improvement that isn't a feature

Comments

@geiseri
Copy link
Contributor

geiseri commented Apr 17, 2019

I am trying to use the docker installed version of the server and can start my application correctly, but I cannot figure out how to connect to it via the browser. On the desktop code I access it on http://localhost:5000. I changed it so that it will listen on all interfaces, but I still cannot contact it from outside the docker. Is there a way to redirect a URL from the exposed site? Or do I need to expose the port in docker and access it that way?

@lucacasonato
Copy link
Contributor

If I understand you correctly you are asking how to expose a port right? You can do this by adding the flag -p 127.0.0.1:5000:5000 to the docker run command.

@geiseri
Copy link
Contributor Author

geiseri commented Apr 19, 2019

This is what I am doing now, but I want to try to do something similar to eclipse che. They allow you to map internal http services to a child mountpoint. That way you only have one port to deal with in a reverse proxy situation.

@infogulch
Copy link

This would be really cool to see. Is there a known, fixed list of api routes that codeserver uses? If some routes are guaranteed to be unused, it would allow a proxy to route a subset of http paths on the same domain to different ports in the container.

Say I'm hosting codeserver in a docker container on a server that has a proxy for automatic https, lets say I put it at https://mycodeserver.example.com/. Just by looking at the browser chatter in the network tab of chrome with the app running, I see request paths like /, /webview.html, /ide.0.08cf8d.js, /resource/src/packages/.... I don't see e.g. /api/* anywhere, so for example maybe I can use my proxy to redirect https://mycodeserver.example.com/api/* to a different port on the codeserver container which would then route to my running application I started inside.

But I'm not sure /api/ specifically is safe, codeserver might use it internally and I just haven't seen it yet (same goes for any other path), so I'd really need a list of known used/free http paths before I could do that confidently.

@Egoscio-zz
Copy link

@infogulch I like your idea, and I'd like to contribute to brainstorming a way of possibly narrowing down request paths, but I feel like this deviates too much from the OP's original issue. How about a separate issue?

@code-asher code-asher changed the title How to expose app port in docker Add a way to proxy/tunnel ports through code-server Sep 17, 2019
@code-asher code-asher added enhancement Some improvement that isn't a feature and removed question labels Sep 17, 2019
@code-asher code-asher changed the title Add a way to proxy/tunnel ports through code-server Add a way to proxy/tunnel ports or view files through code-server Sep 17, 2019
@nhooyr
Copy link
Contributor

nhooyr commented Jan 28, 2020

Duplicate of #1292

@nhooyr nhooyr marked this as a duplicate of #1292 Jan 28, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Jan 28, 2020

Regarding viewing files anyway.

Gonna open a new issue regarding port forwarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

6 participants