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

Support port forwarding for privileged ports (1-1023) #283

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

AkihiroSuda
Copy link
Member

On macOS, listening on 127.0.0.1:80 requires root while 0.0.0.0:80 does not require root.

For such ports, the hostagent launches "pseudoloopback" forwarder that listens on 0.0.0.0:80 but rejects connections from non-loopback src IP.

Fix #45

@AkihiroSuda
Copy link
Member Author

cc @jandubois @mattfarina

}
plf, err := newPseudoLoopbackForwarder(localPort, localUnix)
if err != nil {
_ = os.RemoveAll(localUnixDir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also call forwardSSH(ctx, sshConfig, port, localUnix, remote, true) to tear down the unused forward?

On macOS, listening on 127.0.0.1:80 requires root while 0.0.0.0:80 does not require root.

For such ports, the hostagent launches "pseudoloopback" forwarder that listens on 0.0.0.0:80
but rejects connections from non-loopback src IP.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

Support port forwarding for privileged ports (1-1023)
2 participants