tun2: close http streams after 30 minutes

This commit is contained in:
Cadey Ratio 2017-10-04 15:46:17 -07:00
parent c3b786b992
commit 30f7f4636e
1 changed files with 6 additions and 0 deletions

View File

@ -127,6 +127,12 @@ func (c *Connection) RoundTrip(req *http.Request) (*http.Response, error) {
return nil, errors.Wrap(err, ErrCantOpenSessionStream.Error())
}
go func() {
time.Sleep(30 * time.Minute)
stream.Close()
}()
err = req.Write(stream)
if err != nil {
return nil, errors.Wrap(err, ErrCantWriteRequest.Error())