[tor-commits] [pluggable-transports/snowflake] 12/13: Move uTLS configuration to socks5 arg

gitolite role git at cupani.torproject.org
Wed Mar 16 09:14:20 UTC 2022


This is an automated email from the git hooks/post-receive script.

shelikhoo pushed a commit to branch main
in repository pluggable-transports/snowflake.

commit ab9604476ee7673cf35a3aea33e225946a1426e0
Author: Shelikhoo <xiaokangwang at outlook.com>
AuthorDate: Mon Mar 7 16:32:47 2022 +0000

    Move uTLS configuration to socks5 arg
---
 client/snowflake.go | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/client/snowflake.go b/client/snowflake.go
index 76a5cc4..5856750 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -84,6 +84,17 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
 			if arg, ok := conn.Req.Args.Get("url"); ok {
 				config.BrokerURL = arg
 			}
+			if arg, ok := conn.Req.Args.Get("utls-nosni"); ok {
+				switch strings.ToLower(arg) {
+				case "true":
+					fallthrough
+				case "yes":
+					config.UTLSRemoveSNI = true
+				}
+			}
+			if arg, ok := conn.Req.Args.Get("utls-imitate"); ok {
+				config.UTLSClientID = arg
+			}
 			transport, err := sf.NewSnowflakeClient(config)
 			if err != nil {
 				conn.Reject()
@@ -126,8 +137,6 @@ func main() {
 	frontDomain := flag.String("front", "", "front domain")
 	ampCacheURL := flag.String("ampcache", "", "URL of AMP cache to use as a proxy for signaling")
 	logFilename := flag.String("log", "", "name of log file")
-	uTLSClientHelloID := flag.String("utls-imitate", "", "type of TLS client to imitate with utls")
-	uTLSRemoveSNI := flag.Bool("utls-nosni", false, "remove SNI from client hello(ignored if uTLS is not used)")
 	logToStateDir := flag.Bool("log-to-state-dir", false, "resolve the log file relative to tor's pt state dir")
 	keepLocalAddresses := flag.Bool("keep-local-addresses", false, "keep local LAN address ICE candidates")
 	unsafeLogging := flag.Bool("unsafe-logging", false, "prevent logs from being scrubbed")
@@ -180,8 +189,6 @@ func main() {
 		ICEAddresses:       iceAddresses,
 		KeepLocalAddresses: *keepLocalAddresses || *oldKeepLocalAddresses,
 		Max:                *max,
-		UTLSClientID:       *uTLSClientHelloID,
-		UTLSRemoveSNI:      *uTLSRemoveSNI,
 	}
 
 	// Begin goptlib client process.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list