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

I am trying to setup an HTTP proxy on a Windows machine. Problem is, the password has a special character (@) in it that is causing the set command to fail.

I have tried both escaping the character (\@) and percent-encoding it with the hex value (%40), to no avail.

For example, with the username Foo and password B@r, I have tried the following commands:

set http_proxy=
set http_proxy=

Other than changing the password how can I have the proxy use the password?

5

4 Answers

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

you write this:

So @ gets replaced with %40.

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

3

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

npm config set https-proxy

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 *

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

Based upon this answer on SO, can you try using ^ to escape the @ symbol?

3

You Might Also Like