mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
Fix URLTest session warmup for session-based outbounds
This commit is contained in:
@@ -33,6 +33,8 @@ func RegisterOutbound(registry *outbound.Registry) {
|
||||
outbound.Register[option.NaiveOutboundOptions](registry, C.TypeNaive, NewOutbound)
|
||||
}
|
||||
|
||||
var _ adapter.OutboundWithMultiplex = (*Outbound)(nil)
|
||||
|
||||
type Outbound struct {
|
||||
outbound.Adapter
|
||||
ctx context.Context
|
||||
@@ -257,6 +259,10 @@ func (h *Outbound) ListenPacket(ctx context.Context, destination M.Socksaddr) (n
|
||||
return h.uotClient.ListenPacket(ctx, destination)
|
||||
}
|
||||
|
||||
func (h *Outbound) MultiplexEnabled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (h *Outbound) InterfaceUpdated(ctx context.Context) {
|
||||
h.client.CloseAllConnections()
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ var (
|
||||
_ adapter.OutboundWithPreferredRoutes = (*Endpoint)(nil)
|
||||
_ adapter.InterfaceUpdateListener = (*Endpoint)(nil)
|
||||
_ adapter.Referrer = (*Endpoint)(nil)
|
||||
_ adapter.OutboundWithMultiplex = (*Endpoint)(nil)
|
||||
_ dialer.PacketDialerWithDestination = (*Endpoint)(nil)
|
||||
_ tun.Port = (*Endpoint)(nil)
|
||||
)
|
||||
@@ -756,6 +757,10 @@ func (t *Endpoint) Logout(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *Endpoint) MultiplexEnabled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (t *Endpoint) InterfaceUpdated(ctx context.Context) {
|
||||
if !t.started.Load() {
|
||||
return
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
var (
|
||||
_ adapter.OutboundWithPreferredRoutes = (*Endpoint)(nil)
|
||||
_ adapter.InterfaceUpdateListener = (*Endpoint)(nil)
|
||||
_ adapter.OutboundWithMultiplex = (*Endpoint)(nil)
|
||||
_ dialer.PacketDialerWithDestination = (*Endpoint)(nil)
|
||||
)
|
||||
|
||||
@@ -156,6 +157,10 @@ func (w *Endpoint) Start(stage adapter.StartStage, scope *adapter.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (w *Endpoint) MultiplexEnabled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (w *Endpoint) InterfaceUpdated(ctx context.Context) {
|
||||
if !w.started.Load() {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user