From ae2f5ca09723739022f4e3a7d7139f3bf74fa47a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Tue, 12 Dec 2017 10:18:26 -0800 Subject: [PATCH] internal/tun2: think smarter not harder --- internal/tun2/connection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/tun2/connection.go b/internal/tun2/connection.go index 26851ce..d462909 100644 --- a/internal/tun2/connection.go +++ b/internal/tun2/connection.go @@ -128,7 +128,11 @@ func (c *Connection) RoundTrip(req *http.Request) (*http.Response, error) { if err != nil { return nil, errors.Wrap(err, ErrCantOpenSessionStream.Error()) } - defer stream.Close() + + go func() { + time.Sleep(30 * time.Minute) + stream.Close() + }() err = req.Write(stream) if err != nil {