-
-
Save krancour/02d81675b1e3ef001091abed7e76dba4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type HTTPReverseProxy interface { | |
Proxy(w http.ResponseWriter, r *http.Request) | |
} | |
type httpReverseProxy struct {} | |
func NewHTTPReverseProxy() HTTPReverseProxy { | |
return &httpReverseProxy{} | |
} | |
func (h *httpReverseProxy) Proxy(w http.ResponseWriter, r *http.Request) { | |
if r.ProtoMajor == 2 { | |
// Handle HTTP/2 requests | |
// ... | |
} else { | |
// Handle HTTP/1.x requests | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment