From 3eac22c27d49cd49cac7271aa194353b3080a213 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 21 Nov 2018 14:55:05 +0100 Subject: [PATCH] add missing changes --- app/proxyman/inbound/worker.go | 8 ++++---- app/proxyman/outbound/handler.go | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index d1c4f8db..21e3cb2a 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -105,8 +105,8 @@ func (w *tcpWorker) Proxy() proxy.Inbound { } func (w *tcpWorker) Start() error { - ctx := internet.ContextWithStreamSettings(context.Background(), w.stream) - hub, err := internet.ListenTCP(ctx, w.address, w.port, func(conn internet.Connection) { + ctx := context.Background() + hub, err := internet.ListenTCP(ctx, w.address, w.port, w.stream, func(conn internet.Connection) { go w.callback(conn) }) if err != nil { @@ -342,8 +342,8 @@ func (w *udpWorker) clean() error { func (w *udpWorker) Start() error { w.activeConn = make(map[connID]*udpConn, 16) - ctx := internet.ContextWithStreamSettings(context.Background(), w.stream) - h, err := udp.ListenUDP(ctx, w.address, w.port, udp.HubCapacity(256)) + ctx := context.Background() + h, err := udp.ListenUDP(ctx, w.address, w.port, w.stream, udp.HubCapacity(256)) if err != nil { return err } diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index 547b42a3..aeb83a8b 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -153,11 +153,9 @@ func (h *Handler) Dial(ctx context.Context, dest net.Destination) (internet.Conn } outbound.Gateway = h.senderSettings.Via.AsAddress() } - - ctx = internet.ContextWithStreamSettings(ctx, h.streamSettings) } - return internet.Dial(ctx, dest) + return internet.Dial(ctx, dest, h.streamSettings) } // GetOutbound implements proxy.GetOutbound.