Improve bridge

This commit is contained in:
世界
2026-08-30 17:41:42 +08:00
parent 1e2f1d04da
commit 97bbf2a9a4
21 changed files with 276 additions and 191 deletions
+18 -9
View File
@@ -326,17 +326,26 @@ func (t *Inbound) Start(stage adapter.StartStage) error {
case adapter.StartStateStart:
if t.platformInterface == nil &&
((C.IsLinux && !t.tunOptions.GSO) || (C.IsDarwin && !t.tunOptions.EXP_MultiPendingPackets)) {
outboundManager := service.FromContext[adapter.OutboundManager](t.ctx)
endpointManager := service.FromContext[adapter.EndpointManager](t.ctx)
if endpointManager != nil {
for _, managedEndpoint := range endpointManager.Endpoints() {
if _, isFlowOutbound := managedEndpoint.(adapter.FlowOutbound); isFlowOutbound {
if C.IsLinux {
t.tunOptions.GSO = true
} else {
t.tunOptions.EXP_MultiPendingPackets = true
}
break
for _, outbound := range outboundManager.Outbounds() {
if _, isFlowOutbound := outbound.(adapter.FlowOutbound); isFlowOutbound {
if C.IsLinux {
t.tunOptions.GSO = true
} else {
t.tunOptions.EXP_MultiPendingPackets = true
}
break
}
}
for _, endpoint := range endpointManager.Endpoints() {
if _, isFlowOutbound := endpoint.(adapter.FlowOutbound); isFlowOutbound {
if C.IsLinux {
t.tunOptions.GSO = true
} else {
t.tunOptions.EXP_MultiPendingPackets = true
}
break
}
}
}