FAQ
In my company we have a proxy with a password like "p@ssword!"

so when i set these environment variables:

HTTP_PROXY = http://username:p@ssword!@10.10.10.10:3000
HTTPS_PROXY = http://username:p@ssword!@10.10.10.10:3000

i get "package code.google.com/p/gorest: Get
https://code.google.com/p/gorest/source/checkout?repo=:
authenticationrequired"

I've tried escaping it:

http://username:p^@ssword!@10.10.10.10:3000 ...
http://username:p\@ssword!@10.10.10.10:3000 ...
http://username:p%40ssword!@10.10.10.10:3000 ...
http://username:p/@ssword!@10.10.10.10:3000 *package
code.google.com/p/gorest: Get
https://code.google.com/p/gorest/source/checkout?repo=: http: error
connecting to proxy http://username:p/@password%21@10.10.10.10:3000:
GetHostByName: No such host is known.*

any solution?

--

Search Discussions

  • Krolaw at Oct 8, 2012 at 8:24 pm
    I don't know about proxies. However, if this was simply a get request
    requiring authentication, I'd suggest removing the username:password from
    the url and adding an Authorization header to the request.

    --
  • Brainman at Oct 8, 2012 at 11:55 pm

    On Tuesday, 9 October 2012 02:28:16 UTC+11, Guilherme Lino wrote:

    any solution?
    I think you need to understand what the problem is first.

    I will make a guess. I think your proxy does not like the password your go
    command provides. I take it you are running windows. I do not have proxy
    myself, but I've tried your command:

    C:\>set HTTP_PROXY=http://username:p@ssword!@10.10.10.10:3000

    C:\>echo %HTTP_PROXY%
    http://username:p@ssword!@10.10.10.10:3000

    C:\>go get -d -v code.google.com/p/gorest
    package code.google.com/p/gorest: Get
    https://code.google.com/p/gorest/source/checkout?repo=: http: error
    connecting to proxy http://username:p%40ssword%21@10.10.10.10:3000: dial
    tcp 10.10.10.10:3000: A connection attempt failed because the connected
    party did not properly respond after a period of time, or established
    connection failed because connected host has failed to respond.

    Looking at the error message, I suspect that go command translates your
    HTTP_PROXY variable into http://username:p%40ssword%21@10.10.10.10:3000. I
    think it uses net/url package to parse it, and applies RFC 3986 rules to
    make it compliant. I think your proxy wants "p@ssword!", not
    "p%40ssword%21" for password.

    I am not familiar enough with http and proxy, to say who is right and who
    is wrong here. But, if you can confirm my conclusion, at least, your
    problem will become someone else problem. You could report it with proxy
    developer, or alternative with Go developers
    (http://code.google.com/p/go/issues).

    Alex

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 8, '12 at 4:44p
activeOct 8, '12 at 11:55p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase