diff --git a/docs/changelog.md b/docs/changelog.md index 861709b250..7e09113849 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,27 @@ icon: material/alert-decagram --- +#### 1.14.0-alpha.46 + +* Add multiple tags support to rule-sets **1** +* Add new UDP NAT options **2** +* Fixes and improvements + +**1**: + +The rule-set [`tag`](/configuration/rule-set/#tag) field now accepts a list of +tags to define multiple rule-sets sharing other options at once, with the +`{tag}` placeholder in `path` or `url` replaced by each tag. + +**2**: + +The new [UDP NAT](/configuration/shared/udp-nat/) fields +[`udp_mapping`](/configuration/shared/udp-nat/#udp_mapping), +[`udp_filtering`](/configuration/shared/udp-nat/#udp_filtering) and +[`udp_nat_max`](/configuration/shared/udp-nat/#udp_nat_max) configure the NAT +mapping and filtering behaviors and the maximum number of UDP NAT sessions for +TUN and TProxy inbounds and the WireGuard endpoint. + #### 1.14.0-alpha.45 * Improve the Windows client application **1** diff --git a/go.mod b/go.mod index 9ee4763707..84b4705e9e 100644 --- a/go.mod +++ b/go.mod @@ -186,3 +186,5 @@ require ( lukechampine.com/blake3 v1.3.0 // indirect zombiezen.com/go/capnproto2 v2.18.2+incompatible // indirect ) + +replace github.com/sagernet/sing => github.com/hugeagi/sing v0.0.0-20260717060611-e90ad33f0423 diff --git a/go.sum b/go.sum index aec72e0af8..d03febc24d 100644 --- a/go.sum +++ b/go.sum @@ -111,6 +111,10 @@ github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8 github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/hugeagi/sing v0.0.0-20260628113909-7b04babd5e71 h1:7PgyBcboQORZGlTUdbWnlPBk/HSuBAAT+V+HKBmd6xI= +github.com/hugeagi/sing v0.0.0-20260628113909-7b04babd5e71/go.mod h1:olXxWQNqRW/l2Q6JI3b2Qmz8iQnIFlOeeH8bx6JhgUA= +github.com/hugeagi/sing v0.0.0-20260717060611-e90ad33f0423 h1:ktPcEoJNrCqJYA/I/KtsRru6Qiv5x7J8qvGY1dsaL1Y= +github.com/hugeagi/sing v0.0.0-20260717060611-e90ad33f0423/go.mod h1:olXxWQNqRW/l2Q6JI3b2Qmz8iQnIFlOeeH8bx6JhgUA= github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY= github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= diff --git a/protocol/http/inbound.go b/protocol/http/inbound.go index fe573ea1e0..20b56263e5 100644 --- a/protocol/http/inbound.go +++ b/protocol/http/inbound.go @@ -96,7 +96,16 @@ func (h *Inbound) NewConnection(ctx context.Context, conn net.Conn, metadata ada } conn = tlsConn } - err := http.HandleConnectionEx(ctx, conn, std_bufio.NewReader(conn), h.authenticator, adapter.NewUpstreamHandler(metadata, h.newUserConnection, h.streamUserPacketConnection), metadata.Source, onClose) + err := http.HandleConnectionExWithOptions( + ctx, + conn, + std_bufio.NewReader(conn), + h.authenticator, + adapter.NewUpstreamHandler(metadata, h.newUserConnection, h.streamUserPacketConnection), + metadata.Source, + onClose, + http.HTTPServerOptions{Logger: h.logger}, + ) if err != nil { N.CloseOnHandshakeFailure(conn, onClose, err) h.logger.ErrorContext(ctx, E.Cause(err, "process connection from ", metadata.Source)) diff --git a/protocol/mixed/inbound.go b/protocol/mixed/inbound.go index d35319473a..9b71a7f502 100644 --- a/protocol/mixed/inbound.go +++ b/protocol/mixed/inbound.go @@ -127,7 +127,16 @@ func (h *Inbound) newConnection(ctx context.Context, conn net.Conn, metadata ada case socks4.Version, socks5.Version: return socks.HandleConnectionEx(ctx, conn, reader, h.authenticator, adapter.NewUpstreamHandler(metadata, h.newUserConnection, h.streamUserPacketConnection), h.listener, h.udpTimeout, metadata.Source, onClose) default: - return http.HandleConnectionEx(ctx, conn, reader, h.authenticator, adapter.NewUpstreamHandler(metadata, h.newUserConnection, h.streamUserPacketConnection), metadata.Source, onClose) + return http.HandleConnectionExWithOptions( + ctx, + conn, + reader, + h.authenticator, + adapter.NewUpstreamHandler(metadata, h.newUserConnection, h.streamUserPacketConnection), + metadata.Source, + onClose, + http.HTTPServerOptions{Logger: h.logger}, + ) } }