Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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=http://foo:B\@r@http-gateway.domain.org:80
set http_proxy=http://foo:B%40r@http-gateway.domain.org:80

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

share|improve this question
    
Is the set failing or is the tool using the http_proxy environment variable failing due to the @ symbol? –  Mike Cornell Apr 22 '11 at 13:16
    
Yes. Because the format is username:password@server:port, having @ in the middle of your password causes the right hand side of your password to be considered the hostname, thus the hostname resolution above fails because it thinks the hostname is r@http-gateway.domain.org. The "r@" should not be there. –  Philluminati Nov 3 '11 at 16:23
2  
I tried using %40 and it worked (on Windows), are you sure? –  thegreendroid Oct 29 '12 at 2:32
    
In fact, it works on both Windows and Linux (Ubuntu). –  thegreendroid Oct 29 '12 at 2:55

2 Answers 2

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

http://foo:B@r@http-gateway.domain.org:80

you write this:

http://foo:B%40r@http-gateway.domain.org:80

So @ gets replaced with %40.

share|improve this answer
    
encoding is indeed the way to get around this problem (and many others). –  HTDutchy Jan 11 '13 at 12:00

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

share|improve this answer
    
In response to both, the set is successful, it is the tool using the environment variable: set http_proxy=http://foo:B^@r@http-gateway.domain.org:80 jruby -S gem install rake ERROR: While executing gem ... (URI::InvalidURIError) the scheme http does not accept registry part: foo:B@r@http-gateway.domain.org:80 (or bad hostname?) –  pyropenguin Apr 22 '11 at 15:05
    
This is a Linux based question, not a Windows based question, using ^ doesn't work for me. I still get wget: unable to resolve host address tf4ce@server.company.com'` after setting the proxy environmental variable. –  Philluminati Nov 3 '11 at 16:19
    
Actually it IS a Windows based question...I know pyropenguin personally. –  Mike Cornell Nov 7 '11 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.