question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Unable to forward remotehost:port

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Safari
  • Local OS: MacOS
  • Remote OS: Linux
  • Remote Architecture: amd64
  • code-server --version: 4.8.0

Steps to Reproduce

  1. Spawn a service in a neighbour container
  2. Under ports, paste container-ip:host
  3. It tells remotehost:port is forwarded, but it is unable to do

When I open the forwarded URL proxy, it says

connect ECONNREFUSED 0.0.0.0:8080

Expected

The service running at remotehost:port should be forwarded via web proxy

Actual

Only locally running ports are being forwarded and remorehost:port is not being forwarded unlike VS Code Desktop. It is not even respecting the host part and just attempting to forward a locally running port.

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
code-ashercommented, Nov 7, 2022

Great points and thank you for the links!!

I prefer the query parameter as well but I am concerned that the application itself might use query parameters and have one called ip or maybe it is an app with multiple pages and navigating to a page drops the ip query parameter.

If we embed it into the path on the other hand the application would not be able to mess it up.

We could make it a requirement that applications running behind code-server’s proxy specially treat the ip query variable if it exists but I could see that not going too well. XD

2reactions
benz0licommented, Nov 6, 2022

@code-asher @jsjoeio Please make sure that proxying is restricted to the following ranges:

IPv4

  • 10.0.0.0/8^1
  • 172.16.0.0/12^1
  • 192.168.0.0/16^1

plus 127.0.0.1^2/localhost.

IPv6

  • fc00::/7^3

plus ::1^4/localhost.

Proxying to arbitrary IPs must be prevented.
👉 Otherwise, this opens up an incredible number of (undesirable) use cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while port forwarding to remote host - Mender Hub
Trying to communicate with a remote device via the mender device through port forwarding. if anybody has an idea about what might be...
Read more >
SSH: Troubleshooting "Remote port forwarding failed for listen ...
The objective is to establish a reverse tunnel with port forwarding in order to consistently ssh into a host behind a NAT router...
Read more >
SSH remote port forwarding failed - Server Fault
The reason it failed to reconnect is almost certainly due to the AliveInterval values (kasperd's answer). Using the ExitOnForwardFailure option ...
Read more >
Can't forward port in remote VS Code · Issue #118395 - GitHub
Try to forward a port. Error message: Unable to forward localhost:8000. The host may not be available or that remote port may already...
Read more >
Make a failed SSH forward a fatal error - Unix Stack Exchange
I have a script which connects to a remote host to replicate some files via SSH. I must connect to an rsync daemon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found