ws: allow to set Origin header and default to nil

This commit is contained in:
nadoo committed 2020-11-07 19:20:35 +08:00
1 parent 8a2e95b17e
commit 4887089a4b
6 files changed
+12 -8

No files matched your search

+2
View File
@@ -21,6 +21,7 @@ type WS struct {
addr string
host string
path string
origin string
server proxy.Server
}
@@ -46,6 +47,7 @@ func NewWS(s string, d proxy.Dialer, p proxy.Proxy) (*WS, error) {
addr: addr,
host: u.Query().Get("host"),
path: u.Path,
origin: u.Query().Get("origin"),
}
if w.host == "" {