1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00

handle proxy error in mux client

This commit is contained in:
Darien Raymond 2017-10-20 21:11:13 +02:00
parent 97d300ad15
commit 95c469c1fd

View File

@ -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,