ws和wss的path参数url解码后发送

http代理connect方法支持host参数自定义
Proxy-Agent修改为nginx
This commit is contained in:
wenyifan
2022-08-03 15:47:56 +08:00
parent 2e4aea5188
commit 6d72721cab
8 changed files with 40 additions and 12 deletions

View File

@ -372,7 +372,7 @@ func (h *http2Handler) roundTrip(w http.ResponseWriter, r *http.Request) {
log.Logf("[http2] %s - %s\n%s", r.RemoteAddr, laddr, string(dump))
}
w.Header().Set("Proxy-Agent", "gost/"+Version)
w.Header().Set("Proxy-Agent", ProxyAgent)
if !Can("tcp", host, h.options.Whitelist, h.options.Blacklist) {
log.Logf("[http2] %s - %s : Unauthorized to tcp connect to %s",
@ -768,7 +768,7 @@ func (l *h2Listener) handleFunc(w http.ResponseWriter, r *http.Request) {
dump, _ := httputil.DumpRequest(r, false)
log.Log("[http2]", string(dump))
}
w.Header().Set("Proxy-Agent", "gost/"+Version)
w.Header().Set("Proxy-Agent", ProxyAgent)
conn, err := l.upgrade(w, r)
if err != nil {
log.Logf("[http2] %s - %s %s %s %s: %s",