koding / websocketproxy

WebSocket reverse proxy handler for Go
http://godoc.org/github.com/koding/websocketproxy
MIT License
429 stars 120 forks source link

Copy user agent header from incoming request to fix issue #33 #34

Open f-ld opened 5 years ago

f-ld commented 5 years ago

Propose solution for issue #33

f-ld commented 4 years ago

Any updates? Is this project dead? This is a very simple change and in a couple of clicks it can be merged.

justincmoy commented 3 years ago

It looks like this can be solved without changes to this project. Something like:

wsp := &websocketproxy.WebSocketProxy{
    Director: func(incoming *http.Request, out http.Header) {
        if ua := incoming.Header.Get("User-Agent"); ua != "" {
        out.Add("User-Agent", ua)
    }
    },
}