From 14c8cee4797cbb16c03e4111a162a2c08713d808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 30 Jun 2022 20:03:24 +0800 Subject: [PATCH] Fix missing protocol in metadata --- go.mod | 2 +- go.sum | 4 ++-- shadowaead_2022/service.go | 1 + shadowaead_2022/service_multi.go | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e143fbe..2e197e0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/sagernet/sing-shadowsocks go 1.18 require ( - github.com/sagernet/sing v0.0.0-20220629043543-849d16c37bbb + github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d lukechampine.com/blake3 v1.1.7 ) diff --git a/go.sum b/go.sum index df3577a..9044958 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/sagernet/sing v0.0.0-20220629043543-849d16c37bbb h1:uWSKHyuyi8wIyVDzIvaOqck3yT0gIWonW8JQNRCg8Ok= -github.com/sagernet/sing v0.0.0-20220629043543-849d16c37bbb/go.mod h1:lR0Mc9cBSAgFLGgXWtj5D1X191KeQ/S+LHOhRhuINBo= +github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5 h1:/JHYZ6IY4Q0hkxN2NXaFj8lTJloikj8dekOTsGudrFo= +github.com/sagernet/sing v0.0.0-20220630111757-30b5895320a5/go.mod h1:3ZmoGNg/nNJTyHAZFNRSPaXpNIwpDvyIiAUd0KIWV5c= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8= diff --git a/shadowaead_2022/service.go b/shadowaead_2022/service.go index e3f60b3..dd6a37d 100644 --- a/shadowaead_2022/service.go +++ b/shadowaead_2022/service.go @@ -466,6 +466,7 @@ process: if err != nil { goto returnErr } + metadata.Protocol = "shadowsocks" metadata.Destination = destination s.udpNat.NewPacket(ctx, sessionId, buffer, metadata, func(natConn N.PacketConn) N.PacketWriter { return &serverPacketWriter{s, conn, natConn, session, s.udpBlockCipher} diff --git a/shadowaead_2022/service_multi.go b/shadowaead_2022/service_multi.go index b966b78..241313d 100644 --- a/shadowaead_2022/service_multi.go +++ b/shadowaead_2022/service_multi.go @@ -369,6 +369,7 @@ process: goto returnErr } + metadata.Protocol = "shadowsocks" metadata.Destination = destination s.udpNat.NewContextPacket(ctx, sessionId, buffer, metadata, func(natConn N.PacketConn) (context.Context, N.PacketWriter) { return &shadowsocks.UserContext[U]{ctx, user}, &serverPacketWriter{s.Service, conn, natConn, session, s.uCipher[user]}