Don't show ports that are bound only to localhost
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 1.4k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 5
Description
Bug description
When an application binds to a port on localhost only, as opposed to 0.0.0.0, there's no way that gitpod is going to be able to proxy it, so it might as well be ignored. AFAICT gitpod only proxies ports that are bound on all interfaces.
DrupalPod and ddev-gitpod use ddev, which for security reasons binds a number of ports to localhost only. In the context of Gitpod, there's no reason for Gitpod to even recognize these or point them out to end users, because they're not proxied by gitpod even though they're shown as ports.
Steps to reproduce
As a silly example,
- open https://gitpod.io/#https://github.com/rfay/testtables
- install netcat,
sudo apt-get install -y netcat nc -l localhost 8888
A "Service is available on port 8888" popup will happen, and this port will be shown in the ports list.
But gitpod isn't going to be able to do anything with it, and the user isn't going to be able to do anything with it, because it's bound explicitly to localhost.
If we were to nc -l 0.0.0.0 8888 that would be entirely different, and gitpod and the user could do something with it (although usually only http works, but that's a different conversation).
Would it be possible to detect only listeners that actually matter, that can be proxied?
Expected behavior
Ports that gitpod can't do anything with can't be shown
Example repository
Above
Anything else?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with nc -l localhost 8888 and compare it with a listener on 0.0.0.0, then trace the port detection and proxy filtering entry points in the Gitpod repository. Done means localhost-only listeners no longer appear in the ports list or trigger availability notifications, while proxyable listeners still do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100