add auther config
This commit is contained in:
@ -24,7 +24,6 @@ func init() {
|
||||
}
|
||||
|
||||
type http2Connector struct {
|
||||
user *url.Userinfo
|
||||
md metadata
|
||||
options connector.Options
|
||||
}
|
||||
@ -36,7 +35,6 @@ func NewConnector(opts ...connector.Option) connector.Connector {
|
||||
}
|
||||
|
||||
return &http2Connector{
|
||||
user: options.User,
|
||||
options: options,
|
||||
}
|
||||
}
|
||||
@ -76,7 +74,7 @@ func (c *http2Connector) Connect(ctx context.Context, conn net.Conn, network, ad
|
||||
req.Header.Set("User-Agent", c.md.UserAgent)
|
||||
}
|
||||
|
||||
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