From b933f3447c0b83a28fcaeeca5c64a731fd3753e7 Mon Sep 17 00:00:00 2001 From: Murphy Date: Fri, 23 Jun 2023 23:33:27 -0700 Subject: [PATCH] successfully run tests --- go.mod | 1 + go.sum | 2 ++ internal/netxlite/httpproxy.go | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/go.mod b/go.mod index 24d4cf9e67..8c9ce1054c 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d github.com/dop251/goja_nodejs v0.0.0-20231122114759-e84d9a924c5c github.com/fatih/color v1.16.0 + github.com/felixge/tcpkeepalive v0.0.0-20220224101934-f56176a53a1b github.com/google/go-cmp v0.6.0 github.com/google/gopacket v1.1.19 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 diff --git a/go.sum b/go.sum index 7bba329fee..e0037318a0 100644 --- a/go.sum +++ b/go.sum @@ -130,6 +130,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/felixge/tcpkeepalive v0.0.0-20220224101934-f56176a53a1b h1:h2X1tswmsRG8D1eeDgkf18NYsQkmxK1G6P4uL3QZGIc= +github.com/felixge/tcpkeepalive v0.0.0-20220224101934-f56176a53a1b/go.mod h1:z0yk3Pix6k848RFizhkU4uY36ts5pB1t3toBwudGbBo= github.com/florianl/go-nfqueue v1.1.1-0.20200829120558-a2f196e98ab0 h1:7ZJyJV4KiWBijCCzUPvVaqxsDxO36+KD0XKBdEN3I+8= github.com/flynn/noise v1.0.1 h1:vPp/jdQLXC6ppsXSj/pM3W1BIJ5FEHE2TulSJBpb43Y= github.com/flynn/noise v1.0.1/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= diff --git a/internal/netxlite/httpproxy.go b/internal/netxlite/httpproxy.go index e7ff39544a..98d93baea8 100644 --- a/internal/netxlite/httpproxy.go +++ b/internal/netxlite/httpproxy.go @@ -13,6 +13,18 @@ import ( "time" ) +var ( + // DefaultKeepAliveIdleTime specifies how long connection can be idle + // before sending keepalive message. + DefaultKeepAliveIdleTime = 15 * time.Minute + // DefaultKeepAliveCount specifies maximal number of keepalive messages + // sent before marking connection as dead. + DefaultKeepAliveCount = 8 + // DefaultKeepAliveInterval specifies how often retry sending keepalive + // messages when no response is received. + DefaultKeepAliveInterval = 5 * time.Second +) + // A HttpDialer holds HTTP-specific options // Specifically for HTTP proxy, we build an HTTP tunnel type HttpDialer struct {