ServeHTTP implements the http.Handler interface.
(rw http.ResponseWriter, req *http.Request)
| 94 | |
| 95 | // ServeHTTP implements the http.Handler interface. |
| 96 | func (p *Proxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { |
| 97 | if isWebsocket(req) { |
| 98 | // we don't use https explicitly, ssl termination is done here |
| 99 | req.URL.Scheme = "ws" |
| 100 | p.websocketProxy.ServeHTTP(rw, req) |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | p.httpProxy.ServeHTTP(rw, req) |
| 105 | } |
| 106 | |
| 107 | // isWebsocket checks wether the incoming request is a part of websocket |
| 108 | // handshake |
nothing calls this directly
no test coverage detected