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

@ -222,6 +222,7 @@ type ConnectOptions struct {
UserAgent string
NoTLS bool
NoDelay bool
Host string
HeaderConfig map[string]string
}
@ -277,9 +278,16 @@ func NoDelayConnectOption(b bool) ConnectOption {
}
}
// HeaderConnectOption specifies the NoDelay option for ss.Connect.
// HeaderConnectOption specifies the Header option for ss.Connect.
func HeaderConnectOption(HeaderConfig map[string]string) ConnectOption {
return func(opts *ConnectOptions) {
opts.HeaderConfig = HeaderConfig
}
}
// HostConnectOption specifies the host for connect.
func HostConnectOption(host string) ConnectOption {
return func(opts *ConnectOptions) {
opts.Host = host
}
}