You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)**
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 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.
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.
Activity
jsjoeio commentedon Apr 27, 2021
As you probably saw, running code-server with
--linkprints:The port is random. I thought you might be able to explicitly set it using
PORTbut 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
--linkfrom a different region to where their remote machine is. See #2734 (comment)binaryfire commentedon Apr 27, 2021
@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 commentedon Apr 27, 2021
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