diff --git a/client/client.go b/client/client.go index 2f0d86f46726db3472e9f74bb77e8a99adf0c6d0..900c7526cd5b3e152abbcfc92537706b2d1e28bd 100644 --- a/client/client.go +++ b/client/client.go @@ -236,7 +236,7 @@ func (c *Client) createObfs4Connection(obfs4Endpoint *Obfs4Config) (*Obfs4Conn, return nil, err } - ctx, cancel := context.WithTimeout(context.Background(), dialGiveUpTime) + ctx, cancel := context.WithTimeout(c.ctx, dialGiveUpTime) defer cancel() if c.kcpConfig.Enabled {