protocol: Forward lifecycle Start stage to nested outbounds in vpn, failover and limiters

This commit is contained in:
Shtorm
2026-09-05 04:30:03 +03:00
parent 08703c9035
commit 64605fc47a
6 changed files with 71 additions and 49 deletions
+11 -11
View File
@@ -85,19 +85,19 @@ func (h *Outbound) Network() []string {
return []string{N.NetworkTCP, N.NetworkUDP}
}
func (h *Outbound) Start() error {
detour, loaded := h.outbound.Outbound(h.outboundTag)
if !loaded {
return E.New("outbound not found: ", h.outboundTag)
}
h.detour = detour
for _, stage := range []adapter.StartStage{adapter.StartStateStart, adapter.StartStatePostStart, adapter.StartStateStarted} {
err := h.router.Start(stage)
if err != nil {
return err
func (h *Outbound) Start(stage adapter.StartStage) error {
if stage == adapter.StartStateStart {
detour, loaded := h.outbound.Outbound(h.outboundTag)
if !loaded {
return E.New("outbound not found: ", h.outboundTag)
}
h.detour = detour
}
return nil
return h.router.Start(stage)
}
func (h *Outbound) Close() error {
return h.router.Close()
}
func (h *Outbound) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) {