Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Ports used by --link? #3236

Closed
binaryfire opened this issue Apr 27, 2021 · 3 comments
Closed

Ports used by --link? #3236

binaryfire opened this issue Apr 27, 2021 · 3 comments
Labels
docs Documentation related
Milestone

Comments

@binaryfire
Copy link

binaryfire commented Apr 27, 2021

Hi guys

I'm trying to launch code-server from a firewalled VPS and can't find any information on the ports I need to open for --link to work. Port 8080 is open but that's obviously not it, because I'm getting the following message when visiting the generated URL:

Error connecting to your code-server instance
Ensure code-server is running and was properly started with the --link command line flag.

Which ports does --link use? And is the connection between my server and cdr.co fully encrypted? I got a bit worried when I saw the following in my terminal:

[2021-04-27T12:14:10.297Z] info - Authentication is disabled (disabled by --link)
[2021-04-27T12:14:10.297Z] info - Not serving HTTPS (disabled by --link)**

Thanks!

@binaryfire binaryfire added the docs Documentation related label Apr 27, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 27, 2021

As you probably saw, running code-server with --link prints:

info  HTTP server listening on http://127.0.0.1:50924 (randomized by --link)

The port is random. I thought you might be able to explicitly set it using PORT but that didn't work and led to the same error message you posted 🤔

As for getting around your firewalled VPS with --link, I bet @code-asher or @bpmct may have more insight.

Though it could cause other issues. We have seen issues reported when users access their code-server instance using --link from a different region to where their remote machine is. See #2734 (comment)

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Apr 27, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Apr 27, 2021
@binaryfire
Copy link
Author

@jsjoeio Thanks for the quick reply. I noticed that and tried opening the randomized port but still couldn't get it working. I'm currently in Australia and my VPS provider is in Germany so perhaps that's it... But regardless, the ability to explicitly set the port would be really helpful for those of use behind firewalls.

@code-asher
Copy link
Member

You don't need to open any ports! The cloud agent initiates a connection outward to our cloud then once that connection is established it uses it to proxy traffic. That means the only thing required to make it work is that the agent is able to connect outward to the internet.

I'm not sure there's a proper name for this kind of proxy but I've seen it called an "inverting proxy". This isn't our implementation but you can read a more detailed description of it here: https://github.com/google/inverting-proxy#inverting-proxy-and-agent

@bpmct bpmct closed this as completed Apr 28, 2021
@coder coder locked and limited conversation to collaborators Apr 28, 2021
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
docs Documentation related
Projects
None yet
Development

No branches or pull requests

4 participants