From 9bdfc8abe1f7c0d876e1dd4a58e362579434e69d Mon Sep 17 00:00:00 2001 From: Page Fault Date: Thu, 1 Apr 2021 15:38:04 +0000 Subject: [PATCH] fix smux compatiblity with trojan-r --- tunnel/trojan/server.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tunnel/trojan/server.go b/tunnel/trojan/server.go index 044f3ee99..0018bfd3b 100644 --- a/tunnel/trojan/server.go +++ b/tunnel/trojan/server.go @@ -152,8 +152,14 @@ func (s *Server) acceptLoop() { rewindConn.StopBuffering() switch inboundConn.metadata.Command { case Connect: - s.connChan <- inboundConn - log.Debug("normal trojan connection") + if inboundConn.metadata.DomainName == "MUX_CONN" { + s.muxChan <- inboundConn + log.Debug("mux(r) connection") + } else { + s.connChan <- inboundConn + log.Debug("normal trojan connection") + } + case Associate: s.packetChan <- &PacketConn{ Conn: inboundConn,