-
Notifications
You must be signed in to change notification settings - Fork 18k
http.Get uses proxy incorrectly: 502 bad gateway #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
I have a patch for this, but it's fugly. See http://golang.org/cl/154042 |
Owner changed to r...@golang.org. |
How about something like this as a temp. workaround? --- a/src/pkg/Makefile Tue Jan 12 10:03:02 2010 -0800 +++ b/src/pkg/Makefile Wed Jan 13 11:34:27 2010 -0700 @@ -134,6 +134,14 @@ testing/iotest\ xgb\ +NOTESTFW=\ + net\ + http\ + +ifdef http_proxy +NOTEST+=$(NOTESTFW) +endif + TEST=\ $(filter-out $(NOTEST),$(DIRS)) |
This issue was closed by revision f04b5a3. Status changed to Fixed. |
I made a new build and the tests are failing for the http request due to the proxy code. --- FAIL: http.TestClientHead (0.0 seconds) Last-Modified header not found. --- FAIL: http.TestRedirect (0.0 seconds) Get(http://google.com/) got status 502 at "http://google.com/", want 200 matching "^http://www\\.google\\.[a-z.]+/$" FAIL Here is the important part (from wireshark): GET /robots.txt HTTP/1.1 Host: www.google.com User-Agent: Go http package HTTP/1.1 502 Proxy Error ( The Uniform Resource Locator (URL) does not use a recognized protocol. Either the protocol is not supported or the request was not typed correctly. Confirm that a valid protocol is in use (for example, HTTP for a Web request). ) Via: 1.1 PTLIPRX003 Connection: close Proxy-Connection: close Pragma: no-cache Cache-Control: no-cache Content-Type: text/html Content-Length: 4224 It seems that something is missing. If I do this on the command line it works: telnet 10.152.138.65 8080 Trying 10.152.138.65... Connected to 10.152.138.65. Escape character is '^]'. GET http://www.google.com/robots.txt HTTP/1.1 HTTP/1.1 200 OK Via: 1.1 PTLIPRX004, 1.1 PTLIPRX001, 1.1 PTLIPRX003 Connection: Keep-Alive Proxy-Connection: Keep-Alive Transfer-Encoding: chunked Expires: Thu, 17 Feb 2011 11:18:09 GMT Date: Thu, 17 Feb 2011 11:18:09 GMT Content-Type: text/plain Server: sffe Last-Modified: Mon, 14 Feb 2011 19:41:32 GMT Cache-Control: private, max-age=0 Vary: Accept-Encoding X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block 1000 User-agent: * Disallow: /search ... |
Hi. Ran with wireshark again and what is sent on the wire is basically the same. Here is the contents of the TCP Connection (I omitted the rest of the HTML page returned by the proxy): GET / HTTP/1.1 Host: google.com User-Agent: Go http package HTTP/1.1 502 Proxy Error ( The Uniform Resource Locator (URL) does not use a recognized protocol. Either the protocol is not supported or the request was not typed correctly. Confirm that a valid protocol is in use (for example, HTTP for a Web request). ) Via: 1.1 PTLIPRX001 Connection: close Proxy-Connection: close Pragma: no-cache Cache-Control: no-cache Content-Type: text/html Content-Length: 4222 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Error Message</TITLE> I made a full rebuild just to be sure and checked that I had no changed files locally (hg status). Any thing I can do to help debug it? Thanks. Nuno |
This issue was closed by revision 7bc90ed. Status changed to Fixed. |
I tested behind a firewall with a proxy (sorry for the delay, Carnival :-) ). The http pkg now seems to work well. All the tests pass even when ran behind a firewall. But now the net pkg tests fail behind a firewall. Probably because some test was added there. I supposed these tests will never work behind a firewall... Here is the output of the build after it fails: gopack grc _test/net.a _gotest_.8 make[2]: Leaving directory `/home/nsousa/Projects/google-go/src/pkg/net' --- FAIL: net.TestDialGoogle (5683.3 seconds) -- 72.14.204.104:80 -- Dial("tcp", "", "72.14.204.104:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp4", "", "72.14.204.104:80") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp4", "", "72.14.204.104:80") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp6", "", "72.14.204.104:80") = _, dial tcp6 72.14.204.104:80: connection timed out -- www.google.com:80 -- Dial("tcp", "", "www.google.com:80") = _, dial tcp 72.14.204.99:80: connection timed out Dial("tcp4", "", "www.google.com:80") = _, dial tcp4 72.14.204.103:80: connection timed out Dial("tcp4", "", "www.google.com:80") = _, dial tcp4 72.14.204.147:80: connection timed out Dial("tcp6", "", "www.google.com:80") = _, dial tcp6 72.14.204.99:80: connection timed out -- 72.14.204.104:http -- Dial("tcp", "", "72.14.204.104:http") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp4", "", "72.14.204.104:http") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp4", "", "72.14.204.104:http") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp6", "", "72.14.204.104:http") = _, dial tcp6 72.14.204.104:80: connection timed out -- www.google.com:http -- Dial("tcp", "", "www.google.com:http") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp4", "", "www.google.com:http") = _, dial tcp4 74.125.225.19:80: connection timed out Dial("tcp4", "", "www.google.com:http") = _, dial tcp4 72.14.204.99:80: connection timed out Dial("tcp6", "", "www.google.com:http") = _, dial tcp6 74.125.225.16:80: connection timed out -- 072.014.204.104:0080 -- Dial("tcp", "", "072.014.204.104:0080") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp4", "", "072.014.204.104:0080") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp4", "", "072.014.204.104:0080") = _, dial tcp4 72.14.204.104:80: connection timed out Dial("tcp6", "", "072.014.204.104:0080") = _, dial tcp6 72.14.204.104:80: connection timed out -- [::ffff:72.14.204.104]:80 -- Dial("tcp", "", "[::ffff:72.14.204.104]:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp6", "", "[::ffff:72.14.204.104]:80") = _, dial tcp6 72.14.204.104:80: connection timed out -- [::ffff:480e:cc68]:80 -- Dial("tcp", "", "[::ffff:480e:cc68]:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp6", "", "[::ffff:480e:cc68]:80") = _, dial tcp6 72.14.204.104:80: connection timed out -- [0:0:0:0:0000:ffff:72.14.204.104]:80 -- Dial("tcp", "", "[0:0:0:0:0000:ffff:72.14.204.104]:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp6", "", "[0:0:0:0:0000:ffff:72.14.204.104]:80") = _, dial tcp6 72.14.204.104:80: connection timed out -- [0:0:0:0:000000:ffff:72.14.204.104]:80 -- Dial("tcp", "", "[0:0:0:0:000000:ffff:72.14.204.104]:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp6", "", "[0:0:0:0:000000:ffff:72.14.204.104]:80") = _, dial tcp6 72.14.204.104:80: connection timed out -- [0:0:0:0:0:ffff::72.14.204.104]:80 -- Dial("tcp", "", "[0:0:0:0:0:ffff::72.14.204.104]:80") = _, dial tcp 72.14.204.104:80: connection timed out Dial("tcp6", "", "[0:0:0:0:0:ffff::72.14.204.104]:80") = _, dial tcp6 72.14.204.104:80: connection timed out FAIL make[1]: *** [test] Error 1 make[1]: Leaving directory `/home/nsousa/Projects/google-go/src/pkg/net' make: *** [net.test] Error 2 |
minux
pushed a commit
to minux/goios
that referenced
this issue
Feb 27, 2015
This is compiled as: MOV poollit(PC), REGTEMP ADD SP, REGTMP, R This change allows DWORDs for C_LACON in optab, and sets the pool literal correctly in addpool. Fixes golang#53
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by GSXygon:
The text was updated successfully, but these errors were encountered: