Skip to content

Commit

Permalink
Fixed an error caused of character when @ > 1 during proxy authentica…
Browse files Browse the repository at this point in the history
…tion (#1452)

* Fixed a error caused by more @ character during proxy authentication

* Fixed a error caused by more @ character during proxy authentication
  • Loading branch information
Amzza0x00 committed Dec 8, 2022
1 parent 951f5a1 commit f6aac90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fasthttpproxy/http.go
Expand Up @@ -34,9 +34,9 @@ func FasthttpHTTPDialer(proxy string) fasthttp.DialFunc {
func FasthttpHTTPDialerTimeout(proxy string, timeout time.Duration) fasthttp.DialFunc {
var auth string
if strings.Contains(proxy, "@") {
split := strings.Split(proxy, "@")
auth = base64.StdEncoding.EncodeToString([]byte(split[0]))
proxy = split[1]
index := strings.LastIndex(proxy, "@")
auth = base64.StdEncoding.EncodeToString([]byte(proxy[:index]))
proxy = proxy[index+1:]
}

return func(addr string) (net.Conn, error) {
Expand Down

0 comments on commit f6aac90

Please sign in to comment.