From 95c469c1fd4b7b1b840bcef40cb759596b1290aa Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 20 Oct 2017 21:11:13 +0200 Subject: [PATCH] handle proxy error in mux client --- app/proxyman/mux/mux.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/proxyman/mux/mux.go b/app/proxyman/mux/mux.go index 39e7a825..5425416d 100644 --- a/app/proxyman/mux/mux.go +++ b/app/proxyman/mux/mux.go @@ -90,7 +90,14 @@ func NewClient(p proxy.Outbound, dialer proxy.Dialer, m *ClientManager) (*Client ctx, cancel := context.WithCancel(context.Background()) ctx = proxy.ContextWithTarget(ctx, net.TCPDestination(muxCoolAddress, muxCoolPort)) pipe := ray.NewRay(ctx) - go p.Process(ctx, pipe, dialer) + + go func() { + if err := p.Process(ctx, pipe, dialer); err != nil { + cancel() + log.Trace(errors.New("failed to handler mux client connection").Base(err).AtWarning()) + } + }() + c := &Client{ sessionManager: NewSessionManager(), inboundRay: pipe,