Use `localPort` option during TCP connect
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 546
- Avg merge
- 8h 18m
- Merged PRs (30d)
- 16
Description
For autoNAT to work correctly, we should use the `localPort` option in [socket.connect](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) 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.
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 locating the TCP connection entry point that calls socket.connect and review how the autoNAT interaction chooses its port. Use the Node.js socket.connect options documentation linked in the issue to determine how localPort should be passed. Done means autoNAT interactions use a predictable local port instead of a new ephemeral port each time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100