Skip to content
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

--link fails possibly because of the binding address #3989

Closed
aghasemi opened this issue Aug 15, 2021 · 22 comments
Closed

--link fails possibly because of the binding address #3989

aghasemi opened this issue Aug 15, 2021 · 22 comments
Labels
blocked This issue cannot proceed due to external factors

Comments

@aghasemi
Copy link

aghasemi commented Aug 15, 2021

Hello,
I tried to run code-server with the --link option, and it ran without printing any errors into console, pointing me to some https://****.cdr.co/ address. However, opening that address did not work for me, with the error message "cannot connect to instance.." printed on the Browser screen. Still no error in the console.

I guess the failure to connect is because --link uses 127.0.0.1 as the binding address, whereas in the VPS I use, it must be 0.0.0.0, and that's how I manage to run code-server without --link.

Is there a way to tell --link to use 0.0.0.0 as the binding address and then some random port, instead of 127.0.0.1 and some random port? I have already set bind-addr to 0.0.0.0 in config.toml, but it is apparently ignored by --link.

Many thanks.

OS/Web Information

  • Web Browser: Chrome 92
  • Local OS: ChromeOS
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: AMD Ryzen
  • code-server --version: 3.11.1

Steps to Reproduce

  1. Run code-server with --link on a server that needs the binding address to be 0.0.0.0 to be accessible outside

Expected

Access code-server via cdr.io proxy link

Actual

Code-server is not accessible via proxy link

Update: I looked into the source code and it seems that line 450 of the file cli.ts can do the trick. No?

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 16, 2021

Can you use config.toml? If you can, that's news to me! Usually it's config.yaml. Did you try that already?

cc @code-asher

@aghasemi
Copy link
Author

Yes, it is config.yaml. Sorry for my mistake.

I have set 0.0.0.0:39090 as my bind-addr, but these settings are randomized by --link, as printed on the screen, to 127.0.0.1:SomeRandmPort, where the IP makes the problem.

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 16, 2021

It's too bad you can do something like 0.0.0.0:* but that wouldn't work. I'm not 100% sure how to address this but hopefully @code-asher can chime in. Guessing it won't be till next week though (company off-site this week).

@aghasemi
Copy link
Author

Many thanks. Waiting for it. Honestly, I'm a bit surprised that I am the first one who has this issue.

@mtxweb
Copy link

mtxweb commented Aug 19, 2021

I have had the same problem for a few days

@code-asher
Copy link
Member

code-asher commented Aug 23, 2021 via email

@aghasemi
Copy link
Author

Thanks. So there is no solution right now?

@code-asher
Copy link
Member

code-asher commented Aug 24, 2021 via email

@aghasemi
Copy link
Author

aghasemi commented Aug 25, 2021

It can be. The server (I think) is in the US and I live in Switzerland. Really looking forward to the new version then. I appreciate if you announce it here. Any timeline?

@mtxweb
Copy link

mtxweb commented Aug 25, 2021

If it helps, I also live in switzerland and the server is in germany

@code-asher
Copy link
Member

code-asher commented Aug 25, 2021 via email

@code-asher code-asher added the blocked This issue cannot proceed due to external factors label Oct 27, 2021
@aghasemi
Copy link
Author

Hi. Any news here?

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 28, 2021

No news sadly :( Still waiting for the latest release on link which is done by another team. We'll update here with any news as it comes in! Sorry for the wait

@aghasemi
Copy link
Author

Hi. May I ask please if there is a roadmap for fixing this?

@code-asher
Copy link
Member

code-asher commented Dec 20, 2021 via email

@aghasemi
Copy link
Author

Unfortunately no, the link project looks to be shelved indefinitely. At this point I would recommend using something like Caddy to serve code-server.

Many thanks. That's sad.

Any tutorial or guide about this caddy thing?

@code-asher
Copy link
Member

code-asher commented Dec 20, 2021 via email

@code-asher
Copy link
Member

code-asher commented Dec 20, 2021

Something like ngrok might also work. https://ngrok.com/

Or if you have SSH set up you could port forward through SSH https://github.com/coder/code-server/blob/main/docs/guide.md#port-forwarding-via-ssh

@aghasemi
Copy link
Author

We have a bit of documentation here: https://github.com/coder/code-server/blob/main/docs/guide.md#using-lets-encrypt-with-caddy Lemme know if you run into any trouble.

Many thanks. Sorry for my naïvity, but do I need to do something in Let's Encrypt before going through these steps, or these steps are just all that is required?

@code-asher
Copy link
Member

Yep, those are all the steps required. As long as you have a domain pointing to the right spot Caddy can set up Let's Encrypt for you.

@aghasemi
Copy link
Author

It worked. Amazing. Many thanks.

@stale
Copy link

stale bot commented Jun 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Jun 21, 2022
@stale stale bot closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue cannot proceed due to external factors
Projects
None yet
Development

No branches or pull requests

4 participants