-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added option to set headers for connect request;
- Loading branch information
1 parent
2a633b7
commit ee0f8de
Showing
6 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ type connectDialer struct { | |
// newConnectDialer creates a dialer to issue CONNECT requests and tunnel traffic via HTTP/S proxy. | ||
// proxyUrlStr must provide Scheme and Host, may provide credentials and port. | ||
// Example: https://username:[email protected]:443 | ||
func newConnectDialer(proxyUrlStr string, timeout time.Duration, localAddr *net.TCPAddr, configDialer net.Dialer, logger Logger) (proxy.ContextDialer, error) { | ||
func newConnectDialer(proxyUrlStr string, timeout time.Duration, localAddr *net.TCPAddr, configDialer net.Dialer, connectHeaders http.Header, logger Logger) (proxy.ContextDialer, error) { | ||
proxyUrl, err := url.Parse(proxyUrlStr) | ||
if err != nil { | ||
return nil, err | ||
|
@@ -132,7 +132,7 @@ func newConnectDialer(proxyUrlStr string, timeout time.Duration, localAddr *net. | |
ProxyUrl: *proxyUrl, | ||
Dialer: _dialer, | ||
Timeout: timeout, | ||
DefaultHeader: make(http.Header), | ||
DefaultHeader: connectHeaders, | ||
EnableH2ConnReuse: true, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters