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

Use localPort option during TCP connect #2620

Open
achingbrain opened this issue Jul 16, 2024 · 2 comments
Open

Use localPort option during TCP connect #2620

achingbrain opened this issue Jul 16, 2024 · 2 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@achingbrain
Copy link
Member

For autoNAT to work correctly, we should use the localPort option in socket.connect to ensure we use a predictable port. Otherwise we end up using ephemeral ports and each autoNAT interaction tries to confirm a different port number.

@achingbrain achingbrain added need/triage Needs initial labeling and prioritization kind/enhancement A net-new feature or improvement to an existing feature and removed need/triage Needs initial labeling and prioritization labels Jul 16, 2024
@achingbrain
Copy link
Member Author

I think for this to work we need to be able to open ports with SO_REUSEPORT. This is not currently supported by node.js but it appears to have made it in to libuv so that may change in a future release.

Other reading:

@achingbrain
Copy link
Member Author

reusePort has been added to server.listen as of node 23.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant