Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add localPort parameter on net.connect() #7092

Closed
50ndr33 opened this Issue · 4 comments

3 participants

@50ndr33

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.

@tjfontaine
Owner

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
@tjfontaine tjfontaine added the net label
@tjfontaine tjfontaine self-assigned this
@50ndr33

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

@tjfontaine tjfontaine referenced this issue from a commit in tjfontaine/node
@tjfontaine tjfontaine 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
3fef87c
@tjfontaine tjfontaine referenced this issue from a commit in tjfontaine/node
@tjfontaine tjfontaine 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
0f4fa5f
@tjfontaine tjfontaine closed this issue from a commit
@tjfontaine tjfontaine 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
59baab2
@50ndr33

@tjfontaine did you just update it?

@indutny
Owner

@50ndr33 I guess it is resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.