gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.83k stars 1.23k forks source link

Please allow exposing TCP ports #3184

Closed rfay closed 3 years ago

rfay commented 3 years ago

Describe the bug

Per https://www.gitpod.io/docs/config-ports/

At the moment you can only expose HTTP servers

But so very many applications require us to expose plain non-http TCP ports.

All real computers allow exposing a TCP port. gitpod is awfully close to becoming a real computer! (congrats!)

Steps to reproduce

Expected behavior

Additional information

Example repository

gerardo-junior commented 3 years ago

I can do this with https://github.com/jpillora/chisel doing it by encapsulating the traffic in http packets.

akosyakov commented 3 years ago

We just announced preview version of Gitpod local companion which allows to tunnel any tcp port: https://www.gitpod.io/blog/local-app please try and give us feedback 🙏🏻

rfay commented 3 years ago

This is an outstanding and exciting feature. Where would you like feedback? (I'm able to get simple ports to work, but ssh access doesn't seem to work;

$ ssh -F /tmp/gitpod_ssh_config amaranth-caterpillar-0wh52qdr
kex_exchange_identification: read: Connection reset by peer

(Edit: This works on a newly created instance, just doesn't work on an existing one. Here's on a new one:

 ssh -F /tmp/gitpod_ssh_config indigo-aardwolf-q3gq1lmk
The authenticity of host '[127.0.0.1]:60435 ([127.0.0.1]:60435)' can't be established.
RSA key fingerprint is SHA256:mTU9RnfB/wK3MjonnC8WwrWI4JtV74g7WH21jFTbKoY.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:60435' (RSA) to the list of known hosts.
-bash: rustc: command not found
-bash: /etc/bash_completion.d/cargo: No such file or directory
-bash: rustc: command not found
-bash: /etc/bash_completion.d/cargo: No such file or directory
-bash: pyenv: command not found
-bash: pyenv: command not found

There are a number of things missing in the login, but it definitely works.

rfay commented 3 years ago

Please note that this excellent new feature doesn't address the request in this issue. The idea here would be to actually allow exposing ports on the hostname (or perhaps on a special hostname).

rl-gitpod commented 3 years ago

(Edit: This works on a newly created instance, just doesn't work on an existing one. Here's on a new one:

This is likely due to the existing instance running on an older version of the code that doesn't specify the correct port for the SSH server. It used 0 i.e. next available, which the local companion app cannot use. If you run something like this in the workspace:

ps aux | grep drop

and see '-p :0' not '-p :23001' then that is the reason.

akosyakov commented 3 years ago

Please note that this excellent new feature doesn't address the request in this issue. The idea here would be to actually allow exposing ports on the hostname (or perhaps on a special hostname).

If you elaborate on your use case it would help. I see localhost as a special stable hostname on each you can access any tcp port.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.