add auther config
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user