Skip to content

Commit

Permalink
Merge pull request #60 from rprx/patch-1
Browse files Browse the repository at this point in the history
Remove unused utls
  • Loading branch information
kslr committed Jul 20, 2020
2 parents 34cdd88 + 9311cb1 commit 34d6818
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion go.mod
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -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=
Expand Down
13 changes: 8 additions & 5 deletions transport/internet/tcp/dialer.go
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/tls/tls.go
Expand Up @@ -7,8 +7,6 @@ import (

"v2ray.com/core/common/buf"
"v2ray.com/core/common/net"

utls "github.com/refraction-networking/utls"
)

//go:generate errorgen
Expand Down Expand Up @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 34d6818

Please sign in to comment.