From 32937846c577b2817df9de193fee74d0f8091b01 Mon Sep 17 00:00:00 2001 From: Seyyed Mostafa <10239885+smaznet@users.noreply.github.com> Date: Sat, 11 Apr 2026 22:09:32 +0330 Subject: [PATCH] Tunnel inbound: Compatible with listening UNIX domain socket (#5693) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/XTLS/Xray-core/pull/5693#issuecomment-4229947428 --------- Co-authored-by: 风扇滑翔翼 --- proxy/dokodemo/dokodemo.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index e56363db..7fd197e9 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -2,6 +2,7 @@ package dokodemo import ( "context" + "slices" "strconv" "strings" @@ -56,6 +57,9 @@ func (d *DokodemoDoor) Init(config *Config, pm policy.Manager, sockopt *session. // Network implements proxy.Inbound. func (d *DokodemoDoor) Network() []net.Network { + if slices.Contains(d.config.Networks, net.Network_TCP) { + return append(d.config.Networks, net.Network_UNIX) + } return d.config.Networks } @@ -68,6 +72,10 @@ func (d *DokodemoDoor) policy() policy.Session { // Process implements proxy.Inbound. func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher) error { errors.LogDebug(ctx, "processing connection from: ", conn.RemoteAddr()) + // forward to TCP if from UNIX + if network == net.Network_UNIX { + network = net.Network_TCP + } dest := net.Destination{ Network: network, Address: d.address,