Closed mmatczuk closed 8 years ago
1.5 race check failure is not related to the submitted code, what should I do?
cc @rjeczalik
@mmatczuk The races are going to be fixed with #19. You caught us having red master, not good.
Regarding this feature, could we have instead what Go stdlib is doing for httputil.ReverseProxy, that is to add Director field:
// ServerConfig ...
type ServerConfig struct {
...
// Director ...
Director func(*http.Request)
...
}
And then call it here, if non-nil.
Then you can pass your custom Director function that overwrites r.Host
with X-Forwarded-Host:X-Forwarded-Port
. I think this would be more flexible than hardcoding this logic.
What do you think?
This would make code more flexible indeed. I'll update PR soon.
I removed X-Forwarded logic from this commit to keep tunnel simple. It's now available as a director here.
@mmatczuk :+1:
A server modification that allows http tunneling to any port using X-Forwarded-Port http header. X-Forwarded-Host is also supported for host overwriting.