Skip to content

Commit

Permalink
98 ipv6 proxy (#112)
Browse files Browse the repository at this point in the history
* [+] fix: http proxy handled by http.Transport

* Update README.md

* Update README.md
  • Loading branch information
Noooste authored Jul 24, 2024
1 parent 720c562 commit 7e66538
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ Supported proxy formats include:
*If a scheme is not provided, `http` will be used by default.*
**If you need to use IPV6 proxies, please format it correctly with the appropriate scheme, for example:** `http://user:pass@[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8080`
```go
session := azuretls.NewSession()
defer session.Close()
Expand Down
4 changes: 3 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ func (s *Session) initConn(req *Request) (conn *Conn, err error) {
defer conn.mu.Unlock()

if conn.Conn == nil {
if s.ProxyDialer != nil {
// if the request has HTTP scheme, the default http.Transport will
// take the responsibility of creating the connection
if s.ProxyDialer != nil && (req.parsedUrl.Scheme == SchemeHttps || req.parsedUrl.Scheme == SchemeWss) {
if err = s.getProxyConn(req, conn, host); err != nil {
return nil, err
}
Expand Down

0 comments on commit 7e66538

Please sign in to comment.