[tor-commits] [meek/master] stdlib net/http now support https and socks5 proxies.

dcf at torproject.org dcf at torproject.org
Fri Jan 25 21:07:53 UTC 2019


commit cb2d7d1a6f0c8ada45d22f49ed0524bbc689b1b1
Author: David Fifield <david at bamsoftware.com>
Date:   Fri Jan 25 14:02:28 2019 -0700

    stdlib net/http now support https and socks5 proxies.
    
    socks5 since go1.9:
    https://golang.org/doc/go1.9#net/http
    https://github.com/golang/go/issues/18508
    https://github.com/golang/go/commit/36f55a8b6125c9ae951487a0ad074b5c991f7b92
    
    https since go1.10:
    https://golang.org/doc/go1.10#net/http
    https://github.com/golang/go/issues/11332
    https://github.com/golang/go/commit/f5cd3868d52babd106e0509a67295690246a5252
---
 doc/meek-client.1          |  2 +-
 doc/meek-client.1.txt      |  6 ++++--
 meek-client/meek-client.go | 12 ++++++++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/doc/meek-client.1 b/doc/meek-client.1
index dd9d582..d67f99f 100644
--- a/doc/meek-client.1
+++ b/doc/meek-client.1
@@ -101,7 +101,7 @@ Socks5Proxy localhost:1080
 .sp
 or, equivalently, using the \fB\-\-proxy\fR command line option\&. The command line option takes precedence\&.
 .sp
-When the \fB\-\-helper\fR option is used, you can use any type of proxy: HTTP or SOCKS\&. Without \fB\-\-helper\fR, you can only use an HTTP proxy\&.
+When the \fB\-\-helper\fR option is used, you can use proxies of type http, socks4a, or socks5\&. Without \fB\-\-helper\fR, you can use proxies of type http, https, or socks5\&.
 .SH "OPTIONS"
 .PP
 \fB\-\-front\fR=\fIDOMAIN\fR
diff --git a/doc/meek-client.1.txt b/doc/meek-client.1.txt
index fbfda10..fb559e6 100644
--- a/doc/meek-client.1.txt
+++ b/doc/meek-client.1.txt
@@ -75,8 +75,10 @@ Socks5Proxy localhost:1080
 or, equivalently, using the **--proxy** command line option.
 The command line option takes precedence.
 
-When the **--helper** option is used, you can use any type of proxy:
-HTTP or SOCKS. Without **--helper**, you can only use an HTTP proxy.
+When the **--helper** option is used, you can use proxies of type
+http, socks4a, or socks5.
+Without **--helper**, you can use proxies of type
+http, https, or socks5.
 
 OPTIONS
 -------
diff --git a/meek-client/meek-client.go b/meek-client/meek-client.go
index d8f34c6..dbe6e42 100644
--- a/meek-client/meek-client.go
+++ b/meek-client/meek-client.go
@@ -338,8 +338,16 @@ func acceptLoop(ln *pt.SocksListener) error {
 // configuration.
 func checkProxyURL(u *url.URL) error {
 	if !options.UseHelper {
-		// Without the helper we only support HTTP proxies.
-		if u.Scheme != "http" {
+		// Without the helper, we use net/http's built-in proxy support,
+		// which allows "http", "https", and "socks5".
+		// socks5 requires go1.9: https://golang.org/doc/go1.9#net/http
+		// https requires go1.10: https://golang.org/doc/go1.10#net/http
+		// If using an older version of Go, the proxy won't be bypassed;
+		// you'll just get an error at connection time rather than
+		// TOR_PT_PROXY time.
+		switch u.Scheme {
+		case "http", "https", "socks5":
+		default:
 			return fmt.Errorf("don't understand proxy URL scheme %q", u.Scheme)
 		}
 	} else {



More information about the tor-commits mailing list