Skip to content

Commit 0c7c64c

Browse files
committed
Fix missing inbound options
1 parent 94abfdc commit 0c7c64c

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

protocol/direct/inbound.go

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ func (i *Inbound) NewConnectionEx(ctx context.Context, conn net.Conn, metadata a
110110
i.logger.InfoContext(ctx, "inbound connection to ", metadata.Destination)
111111
metadata.Inbound = i.Tag()
112112
metadata.InboundType = i.Type()
113+
metadata.InboundDetour = i.listener.ListenOptions().Detour
114+
metadata.InboundOptions = i.listener.ListenOptions().InboundOptions
113115
i.router.RouteConnectionEx(ctx, conn, metadata, onClose)
114116
}
115117

@@ -119,6 +121,8 @@ func (i *Inbound) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn,
119121
var metadata adapter.InboundContext
120122
metadata.Inbound = i.Tag()
121123
metadata.InboundType = i.Type()
124+
metadata.InboundDetour = i.listener.ListenOptions().Detour
125+
metadata.InboundOptions = i.listener.ListenOptions().InboundOptions
122126
metadata.Source = source
123127
metadata.Destination = destination
124128
metadata.OriginDestination = i.listener.UDPAddr()

protocol/redirect/redirect.go

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (h *Redirect) NewConnectionEx(ctx context.Context, conn net.Conn, metadata
5959
}
6060
metadata.Inbound = h.Tag()
6161
metadata.InboundType = h.Type()
62+
metadata.InboundDetour = h.listener.ListenOptions().Detour
63+
metadata.InboundOptions = h.listener.ListenOptions().InboundOptions
6264
metadata.Destination = M.SocksaddrFromNetIP(destination)
6365
h.logger.InfoContext(ctx, "inbound connection to ", metadata.Destination)
6466
h.router.RouteConnectionEx(ctx, conn, metadata, onClose)

protocol/redirect/tproxy.go

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ func (t *TProxy) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, s
101101
var metadata adapter.InboundContext
102102
metadata.Inbound = t.Tag()
103103
metadata.InboundType = t.Type()
104+
metadata.InboundDetour = t.listener.ListenOptions().Detour
105+
metadata.InboundOptions = t.listener.ListenOptions().InboundOptions
104106
metadata.Source = source
105107
metadata.Destination = destination
106108
metadata.OriginDestination = t.listener.UDPAddr()

protocol/shadowsocks/inbound.go

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ func (h *Inbound) newConnection(ctx context.Context, conn net.Conn, metadata ada
120120
h.logger.InfoContext(ctx, "inbound connection to ", metadata.Destination)
121121
metadata.Inbound = h.Tag()
122122
metadata.InboundType = h.Type()
123+
metadata.InboundDetour = h.listener.ListenOptions().Detour
124+
metadata.InboundOptions = h.listener.ListenOptions().InboundOptions
123125
return h.router.RouteConnection(ctx, conn, metadata)
124126
}
125127

protocol/shadowsocks/inbound_multi.go

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ func (h *MultiInbound) newConnection(ctx context.Context, conn net.Conn, metadat
138138
h.logger.InfoContext(ctx, "[", user, "] inbound connection to ", metadata.Destination)
139139
metadata.Inbound = h.Tag()
140140
metadata.InboundType = h.Type()
141+
metadata.InboundDetour = h.listener.ListenOptions().Detour
142+
metadata.InboundOptions = h.listener.ListenOptions().InboundOptions
141143
return h.router.RouteConnection(ctx, conn, metadata)
142144
}
143145

protocol/shadowsocks/inbound_relay.go

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ func (h *RelayInbound) newConnection(ctx context.Context, conn net.Conn, metadat
123123
h.logger.InfoContext(ctx, "[", destination, "] inbound connection to ", metadata.Destination)
124124
metadata.Inbound = h.Tag()
125125
metadata.InboundType = h.Type()
126+
metadata.InboundDetour = h.listener.ListenOptions().Detour
127+
metadata.InboundOptions = h.listener.ListenOptions().InboundOptions
126128
return h.router.RouteConnection(ctx, conn, metadata)
127129
}
128130

0 commit comments

Comments
 (0)