Skip to content

Ports used by --link? #3236

Description

@binaryfire

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!

Activity

  1. jsjoeio commented on Apr 27, 2021

    @jsjoeio
    Contributor

    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)

  2. added this to the On Deck milestone on Apr 27, 2021
  3. binaryfire commented on Apr 27, 2021

    @binaryfire
    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.

  4. code-asher commented on Apr 27, 2021

    @code-asher
    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

  5. locked and limited conversation to collaborators on Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation related

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions