-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: set LocalAddrContextKey after conn accepted #18686
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
Comments
#18734 is not a duplicate since it's a special case and socket which this address is always changing du to the diffrent connections that is being intercepted by the proxy. |
CL https://golang.org/cl/35490 mentions this issue. |
Since someone has already provided a CL for this, should the HelpWanted label be removed? |
@gopherbot @bradfitz I didn't understood the changes mentioned by the bot. |
Why it planned to go 1.9 instead go 1.8.1? I think it is very small change - small fix small bug, no language change. I need local ip too for https://github.com/rekby/lets-proxy it need to route requests. Now I have forked http package to own copy for workaround the problem and wait solve in standard library. |
Because we only fix critical bugs/regressions without workarounds in 1.x.y point releases. |
I don't know what the protocol for closed issues is, but shouldn't this be reflected in the patch notes? |
@sabey so, is it working? is there a solution? |
it does work, the change was just unexpected as I couldn't find the documentation for it |
From comment on closed issue: #6732 (comment)
The http server sets
LocalAddrContextKey
inServe(Listener)
before any accept.So if you pass a
Listener
listening on 0.0.0.0, that is whatLocalAddrContextKey
will say also. The current implementation considered only the case of distinguishing between multiple explicit listeners, not distinguishing the addresses arriving on a wildcard interface.Instead, we should set the context value after an accept takes place.
/cc @SpComb
The text was updated successfully, but these errors were encountered: