add sid for connector log

This commit is contained in:
ginuerzh
2024-09-20 18:20:57 +08:00
parent e37213ac01
commit e09ec08881
22 changed files with 142 additions and 46 deletions
+2
View File
@@ -10,6 +10,7 @@ import (
"github.com/go-gost/core/connector"
md "github.com/go-gost/core/metadata"
"github.com/go-gost/relay"
ctxvalue "github.com/go-gost/x/ctx"
relay_util "github.com/go-gost/x/internal/util/relay"
"github.com/go-gost/x/registry"
)
@@ -44,6 +45,7 @@ func (c *relayConnector) Connect(ctx context.Context, conn net.Conn, network, ad
"local": conn.LocalAddr().String(),
"network": network,
"address": address,
"sid": string(ctxvalue.SidFromContext(ctx)),
})
log.Debugf("connect %s/%s", address, network)