net/http: set LocalAddrContextKey after conn accepted #18686
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: