Skip to content

Commit

Permalink
Merge branch 'XTLS:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
omengye authored Nov 21, 2024
2 parents 0ffa125 + 6ba0dba commit c15c090
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions common/log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func TestFileLogger(t *testing.T) {
common.Must(err)
path := f.Name()
common.Must(f.Close())
defer os.Remove(path)

creator, err := CreateFileLogWriter(path)
common.Must(err)
Expand Down
23 changes: 14 additions & 9 deletions proxy/wireguard/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,20 @@ func (s *Server) forwardConnection(dest net.Destination, conn net.Conn) {
Reason: "",
})

if s.info.inboundTag != nil {
ctx = session.ContextWithInbound(ctx, s.info.inboundTag)
}
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)
}
// what's this?
// Session information should not be shared between different connections
// why reuse them in server level? This will cause incorrect destoverride and unexpected routing behavior.
// Disable it temporarily. Maybe s.info should be removed.

// if s.info.inboundTag != nil {
// ctx = session.ContextWithInbound(ctx, s.info.inboundTag)
// }
// 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)
if err != nil {
Expand Down

0 comments on commit c15c090

Please sign in to comment.