add auther config

This commit is contained in:
ginuerzh
2022-02-12 00:33:20 +08:00
parent c1bf501734
commit a8a6bbc3a3
37 changed files with 261 additions and 183 deletions

View File

@ -23,7 +23,6 @@ func init() {
}
type httpConnector struct {
user *url.Userinfo
md metadata
options connector.Options
}
@ -35,7 +34,6 @@ func NewConnector(opts ...connector.Option) connector.Connector {
}
return &httpConnector{
user: options.User,
options: options,
}
}
@ -67,7 +65,7 @@ func (c *httpConnector) Connect(ctx context.Context, conn net.Conn, network, add
}
req.Header.Set("Proxy-Connection", "keep-alive")
if user := c.user; user != nil {
if user := c.options.Auth; user != nil {
u := user.Username()
p, _ := user.Password()
req.Header.Set("Proxy-Authorization",