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

Is there a loop in the command? #11

Open
songyu-wang98 opened this issue Sep 29, 2022 · 1 comment
Open

Is there a loop in the command? #11

songyu-wang98 opened this issue Sep 29, 2022 · 1 comment

Comments

@songyu-wang98
Copy link

I'm new to Docker and I'm confused when I try to understand the command

docker run --rm -it -p <listen-port>:<listen-port> -p <remote-port>:<remote-port> kevinwan/tproxy:v1 tproxy -l 0.0.0.0 -p <listen-port> -r host.docker.internal:<remote-port>

I'm gonna split the command into 2 parts:

  1. docker run --rm -it -p <listen-port>:<listen-port> -p <remote-port>:<remote-port> kevinwan/tproxy:v1: The flag -p map 2 ports of the host to the container, that't alright;
  2. tproxy -l 0.0.0.0 -p <listen-port> -r host.docker.internal:<remote-port>: The -r host.docker.internal:<remote-port> part cause the container access the host port directly, which I think may cause a loop like this:

Docker 端口映射

Could you please help me to figure it out?

@kevwan
Copy link
Owner

kevwan commented Jan 20, 2023

Yes, I think so. It's actually the same port that the traffic goes to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants