Browse Source

Merge pull request #60 from rprx/patch-1

Remove unused utls
Kslr 5 years ago
parent
commit
34d6818a85
4 changed files with 10 additions and 10 deletions
  1. 0 1
      go.mod
  2. 0 2
      go.sum
  3. 8 5
      transport/internet/tcp/dialer.go
  4. 2 2
      transport/internet/tls/tls.go

+ 0 - 1
go.mod

@@ -7,7 +7,6 @@ require (
 	github.com/google/go-cmp v0.5.0
 	github.com/gorilla/websocket v1.4.2
 	github.com/miekg/dns v1.1.30
-	github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57
 	github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841
 	github.com/stretchr/testify v1.6.1
 	github.com/xiaokangwang/VSign v0.0.0-20200704130305-63f4b4d7a751

+ 0 - 2
go.sum

@@ -51,8 +51,6 @@ github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rK
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57 h1:SL1K0QAuC1b54KoY1pjPWe6kSlsFHwK9/oC960fKrTY=
-github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0=
 github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841 h1:pnfutQFsV7ySmHUeX6ANGfPsBo29RctUvDn8G3rmJVw=
 github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841/go.mod h1:ET5mVvNjwaGXRgZxO9UZr7X+8eAf87AfIYNwRSp9s4Y=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

+ 8 - 5
transport/internet/tcp/dialer.go

@@ -22,11 +22,14 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
 
 	if config := tls.ConfigFromStreamSettings(streamSettings); config != nil {
 		tlsConfig := config.GetTLSConfig(tls.WithDestination(dest))
-		if config.IsExperiment8357() {
-			conn = tls.UClient(conn, tlsConfig)
-		} else {
-			conn = tls.Client(conn, tlsConfig)
-		}
+		/*
+			if config.IsExperiment8357() {
+				conn = tls.UClient(conn, tlsConfig)
+			} else {
+				conn = tls.Client(conn, tlsConfig)
+			}
+		*/
+		conn = tls.Client(conn, tlsConfig)
 	}
 
 	tcpSettings := streamSettings.ProtocolSettings.(*Config)

+ 2 - 2
transport/internet/tls/tls.go

@@ -7,8 +7,6 @@ import (
 
 	"v2ray.com/core/common/buf"
 	"v2ray.com/core/common/net"
-
-	utls "github.com/refraction-networking/utls"
 )
 
 //go:generate errorgen
@@ -45,6 +43,7 @@ func Client(c net.Conn, config *tls.Config) net.Conn {
 	return &Conn{Conn: tlsConn}
 }
 
+/*
 func copyConfig(c *tls.Config) *utls.Config {
 	return &utls.Config{
 		NextProtos:         c.NextProtos,
@@ -59,6 +58,7 @@ func UClient(c net.Conn, config *tls.Config) net.Conn {
 	uConfig := copyConfig(config)
 	return utls.Client(c, uConfig)
 }
+*/
 
 // Server initiates a TLS server handshake on the given connection.
 func Server(c net.Conn, config *tls.Config) net.Conn {