This repository has been archived by the owner. It is now read-only.

Add localPort parameter on net.connect() #7092

Closed
50ndr33 opened this Issue Feb 10, 2014 · 4 comments

Comments

Projects
None yet
3 participants

50ndr33 commented Feb 10, 2014

Being able to decide which local port should be used when opening a TCP socket is essential to do for example TCP hole punching. Please add this feature.

I was going to add this myself, but if you can get a PR done before me that'd be great

@tjfontaine tjfontaine added this to the v0.12 milestone Feb 10, 2014

@tjfontaine tjfontaine added the net label Feb 10, 2014

@tjfontaine tjfontaine self-assigned this Feb 10, 2014

50ndr33 commented Feb 11, 2014

I have very little experience in C. If you know the API better, you should do it, as it requires a bit editing.

tjfontaine added a commit to tjfontaine/node that referenced this issue Feb 18, 2014

net: add localPort to connect options
Expose localPort for binding to a specific port for outbound
connections.

If localAddress is not specified '0.0.0.0' is used for ip4 and '::'
for ip6 connections.

Fixes #7092

tjfontaine added a commit to tjfontaine/node that referenced this issue Feb 18, 2014

net: add localPort to connect options
Expose localPort for binding to a specific port for outbound
connections.

If localAddress is not specified '0.0.0.0' is used for ip4 and '::'
for ip6 connections.

Fixes #7092

50ndr33 commented Feb 18, 2014

@tjfontaine did you just update it?

Member

indutny commented Feb 18, 2014

@50ndr33 I guess it is resolved now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.