delvedor / hpagent

A ready to use http and https agent for working with proxies that keeps connections alive!
MIT License
182 stars 36 forks source link

Proxy username/password get percent-encoded because of `new URL` when they shouldn't #39

Closed Ricardonacif closed 2 years ago

Ricardonacif commented 2 years ago

On the example below, because of the internal use of new URL to parse the proxy url, the username and password get percent-encoded. This is ideal for URLs, but when we are parsing for username and password for proxy auth, that breaks the strings because the username is converted to username_with_%3D:

new HttpsProxyAgent({
          proxy: 'http://username_with_=:password@33.206.125.154:8888',
        });```

I have used some proxy providers where there are = chars on the username and for instance on chrome the proxies work fine, but not on hpagent. Should we forcely decoded that on username/password?

gaetanlegac commented 2 years ago

I have the same issue, getting a 422 error when the password contains a ;.