-
-
Save krancour/518f0ee2cc19b4adb8e5b7cdcd1473f2 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
func (h *httpReverseProxy) Proxy(w http.ResponseWriter, r *http.Request) { | |
if r.ProtoMajor == 2 { | |
proxyHTTP2Request(w, r) | |
} else { | |
proxyHTTP1xRequest(w, r) | |
} | |
} | |
func proxyHTTP2Request(w http.ResponseWriter, r *http.Request) { | |
// Handle HTTP/2 requests | |
// ... | |
} | |
func proxyHTTP1xRequest(w http.ResponseWriter, r *http.Request) { | |
// Handle HTTP/1.x requests | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment