How to use special characters in username/password for HTTP proxy?

Solution 1:

You have to percent-encode | encode the special characters. E.g. instead of this:

http://foo:B@[email protected]:80

you write this:

http://foo:B%[email protected]:80

So @ gets replaced with %40.

Note: foo = username, b@r = password, http-gateway.domain.org = host proxy to connect

Solution 2:

For any special characters, in username or password, we can always use UTF-8 encoded strings in its place. For example: ! can be replaced with %21

so the command would be, if password is abc!:

npm config set proxy http://user:abc%[email protected]:8080/

npm config set https-proxy http://user:abc%[email protected]:8080/

Solution 3:

Use %Ascii code of the special character in hexadecimal notation for any special character. Suppose My password is AB@12#& then the password should be set as

git config --global http.proxy *http://usernamne:**AB%4012%23%26**@myipadress:portnumber*

Refer to ascii table for knowing the hexadecimal ascii code of any number.