|
|
@ -144,15 +144,20 @@ func (s *Server) forwardConnection(dest net.Destination, conn net.Conn) {
|
|
|
|
Reason: "",
|
|
|
|
Reason: "",
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
if s.info.inboundTag != nil {
|
|
|
|
// what's this?
|
|
|
|
ctx = session.ContextWithInbound(ctx, s.info.inboundTag)
|
|
|
|
// Session information should not be shared between different connections
|
|
|
|
}
|
|
|
|
// why reuse them in server level? This will cause incorrect destoverride and unexpected routing behavior.
|
|
|
|
if s.info.outboundTag != nil {
|
|
|
|
// Disable it temporarily. Maybe s.info should be removed.
|
|
|
|
ctx = session.ContextWithOutbounds(ctx, []*session.Outbound{s.info.outboundTag})
|
|
|
|
|
|
|
|
}
|
|
|
|
// if s.info.inboundTag != nil {
|
|
|
|
if s.info.contentTag != nil {
|
|
|
|
// ctx = session.ContextWithInbound(ctx, s.info.inboundTag)
|
|
|
|
ctx = session.ContextWithContent(ctx, s.info.contentTag)
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// if s.info.outboundTag != nil {
|
|
|
|
|
|
|
|
// ctx = session.ContextWithOutbounds(ctx, []*session.Outbound{s.info.outboundTag})
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if s.info.contentTag != nil {
|
|
|
|
|
|
|
|
// ctx = session.ContextWithContent(ctx, s.info.contentTag)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
link, err := s.info.dispatcher.Dispatch(ctx, dest)
|
|
|
|
link, err := s.info.dispatcher.Dispatch(ctx, dest)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|