From a967afd45305eff909a95fb472813a86cf6fea87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 14 Apr 2023 19:19:27 +0800 Subject: [PATCH] Update dependencies --- go.mod | 2 +- go.sum | 4 ++-- outbound/shadowsocks.go | 2 +- outbound/trojan.go | 2 +- outbound/vless.go | 2 +- transport/simple-obfs/tls.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 8b0dc56a..f798f399 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( berty.tech/go-libtor v1.0.385 - github.com/Dreamacro/clash v1.14.0 + github.com/Dreamacro/clash v1.15.0 github.com/caddyserver/certmagic v0.17.2 github.com/cretz/bine v0.2.0 github.com/dustin/go-humanize v1.0.1 diff --git a/go.sum b/go.sum index e604652c..b1e2de5b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ berty.tech/go-libtor v1.0.385 h1:RWK94C3hZj6Z2GdvePpHJLnWYobFr3bY/OdUJ5aoEXw= berty.tech/go-libtor v1.0.385/go.mod h1:9swOOQVb+kmvuAlsgWUK/4c52pm69AdbJsxLzk+fJEw= -github.com/Dreamacro/clash v1.14.0 h1:ehJ/C/1m9LEjmME72WSE/Y2YqbR3Q54AbjqiRCvtyW4= -github.com/Dreamacro/clash v1.14.0/go.mod h1:ia2CU7V713H1QdCqMwOLK9U9V5Ay8X0voj3yQr2tk+I= +github.com/Dreamacro/clash v1.15.0 h1:mlpD950VEggXZBNahV66hyKDRxcczkj3vymoAt78KyE= +github.com/Dreamacro/clash v1.15.0/go.mod h1:WNH69bN11LiAdgdSr4hpkEuXVMfBbWyhEKMCTx9BtNE= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= diff --git a/outbound/shadowsocks.go b/outbound/shadowsocks.go index 0741eb80..e196c03a 100644 --- a/outbound/shadowsocks.go +++ b/outbound/shadowsocks.go @@ -157,7 +157,7 @@ func (h *shadowsocksDialer) DialContext(ctx context.Context, network string, des if err != nil { return nil, err } - return &bufio.BindPacketConn{PacketConn: h.method.DialPacketConn(outConn), Addr: destination}, nil + return bufio.NewBindPacketConn(h.method.DialPacketConn(outConn), destination), nil default: return nil, E.Extend(N.ErrUnknownNetwork, network) } diff --git a/outbound/trojan.go b/outbound/trojan.go index b30d88d5..2e4bc96a 100644 --- a/outbound/trojan.go +++ b/outbound/trojan.go @@ -131,7 +131,7 @@ func (h *trojanDialer) DialContext(ctx context.Context, network string, destinat case N.NetworkTCP: return trojan.NewClientConn(conn, h.key, destination), nil case N.NetworkUDP: - return &bufio.BindPacketConn{PacketConn: trojan.NewClientPacketConn(conn, h.key), Addr: destination}, nil + return bufio.NewBindPacketConn(trojan.NewClientPacketConn(conn, h.key), destination), nil default: return nil, E.Extend(N.ErrUnknownNetwork, network) } diff --git a/outbound/vless.go b/outbound/vless.go index ac5eb02d..adb84df0 100644 --- a/outbound/vless.go +++ b/outbound/vless.go @@ -111,7 +111,7 @@ func (h *VLESS) DialContext(ctx context.Context, network string, destination M.S if err != nil { return nil, err } - return &bufio.BindPacketConn{PacketConn: packetaddr.NewConn(packetConn, destination), Addr: destination}, nil + return bufio.NewBindPacketConn(packetaddr.NewConn(packetConn, destination), destination), nil } else { return h.client.DialEarlyPacketConn(conn, destination) } diff --git a/transport/simple-obfs/tls.go b/transport/simple-obfs/tls.go index fb8356cd..51756fdb 100644 --- a/transport/simple-obfs/tls.go +++ b/transport/simple-obfs/tls.go @@ -32,10 +32,10 @@ type TLSObfs struct { func (to *TLSObfs) read(b []byte, discardN int) (int, error) { buf := B.Get(discardN) _, err := io.ReadFull(to.Conn, buf) + B.Put(buf) if err != nil { return 0, err } - B.Put(buf) sizeBuf := make([]byte, 2) _, err = io.ReadFull(to.Conn, sizeBuf)