http://0.0.0.0 and set the Host on the http.Request to whatever I want.
This is handy for testing infrastructure that does routing or serving
based on the host header.
For web socket requests it looks like the config.Location.Host that is used
in the dial is also always used in the handshake. Since the web socket
client has access to the http headers I'd like to be able to set the Host
header and have it reflected in the handshake, taking priority over the
config.Location.Host. Like this:
https://github.com/pweil-/net/compare/golang:master...master
A small nit on my code snippet, this would deviate from the way a
http.Request sets the Host. It is a documented item that http.Request uses
an explicit Host field rather than what is set in the header. Perhaps, if
this is a good feature for web sockets, the explicit field pattern should
be followed.
Thoughts?
Paul
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.