| // Copyright 2012 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // direct-tcpip functional tests |
| func TestTCPIPHTTP(t *testing.T) { |
| // google.com will generate at least one redirect, possibly three |
| // depending on your location. |
| doTest(t, "http://google.com") |
| func TestTCPIPHTTPS(t *testing.T) { |
| doTest(t, "https://encrypted.google.com/") |
| func doTest(t *testing.T, url string) { |
| conn := server.Dial(clientConfig()) |
| Dial: func(n, addr string) (net.Conn, error) { |
| return conn.Dial(n, addr) |
| resp, err := client.Get(url) |
| t.Fatalf("unable to proxy: %s", err) |
| // got a body without error |