Fix inbound contexts

This commit is contained in:
世界
2024-11-17 15:16:38 +08:00
parent 6731c374d8
commit b4de539ae5
7 changed files with 56 additions and 12 deletions

View File

@@ -102,6 +102,10 @@ func (h *Inbound) NewConnection(ctx context.Context, conn net.Conn, metadata ada
}
func (h *Inbound) newConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
metadata.Inbound = h.Tag()
metadata.InboundType = h.Type()
metadata.InboundDetour = h.listener.ListenOptions().Detour
metadata.InboundOptions = h.listener.ListenOptions().InboundOptions
if userName, _ := auth.UserFromContext[string](ctx); userName != "" {
metadata.User = userName
h.logger.InfoContext(ctx, "[", userName, "] inbound connection to ", metadata.Destination)