Fix UDP domain NAT

This commit is contained in:
世界
2023-10-25 12:00:00 +08:00
parent 23aa8a0543
commit cb2e15f8a7
11 changed files with 138 additions and 13 deletions

View File

@@ -75,3 +75,11 @@ func AppendContext(ctx context.Context) (context.Context, *InboundContext) {
metadata = new(InboundContext)
return WithContext(ctx, metadata), metadata
}
func ExtendContext(ctx context.Context) (context.Context, *InboundContext) {
var newMetadata InboundContext
if metadata := ContextFrom(ctx); metadata != nil {
newMetadata = *metadata
}
return WithContext(ctx, &newMetadata), &newMetadata
}