dlundquist / sniproxy

Proxies incoming HTTP and TLS connections based on the hostname contained in the initial request of the TCP session.
BSD 2-Clause "Simplified" License
2.57k stars 398 forks source link

Requests sent to server take unusually long to respond #332

Open zanechua opened 5 years ago

zanechua commented 5 years ago

I have an issue with the current 0.6.0 build of sniproxy where requests sent to a server take an unusually long time to respond e.g. up to 4 minutes.

Current Route Computer -> PfSense -> Proxy Server -> Server

Debug Route Computer -> Charles Web Debugging Proxy -> PfSense -> Proxy Server -> Server

The current route causes the requests to take up to 4minutes to respond which makes the website to be proxied error out with a ton of 503 errors in chrome.

Initially I introduced the Charles proxy as a way to debug the requests to find out what was going on but I realised that when I introduced the proxy, the requests are handled in the normal few seconds that it would take to handle them.

These are some of the access logs.

2019-04-14 19:58:18 x.x.x.x:15202 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 13306/13306 bytes tx 1649/1649 bytes rx 75.698 seconds 2019-04-14 19:58:19 x.x.x.x:46690 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 10675/10675 bytes tx 1648/1648 bytes rx 75.829 seconds 2019-04-14 19:58:19 x.x.x.x:33614 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 15607/15607 bytes tx 2137/2137 bytes rx 76.297 seconds 2019-04-14 19:58:19 x.x.x.x:29344 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 16805/16805 bytes tx 2136/2136 bytes rx 76.231 seconds 2019-04-14 19:58:19 x.x.x.x:3978 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 32788/32788 bytes tx 2629/2629 bytes rx 76.385 seconds 2019-04-14 19:58:19 x.x.x.x:49177 -> 10.0.0.4:443 -> 208.111.155.170:443 [6.viki.io] 52056/52056 bytes tx 2140/2140 bytes rx 76.542 seconds 2019-04-14 19:58:20 x.x.x.x:27888 -> 10.0.0.4:443 -> 208.111.155.170:443 [0.viki.io] 20170/20170 bytes tx 1670/1670 bytes rx 75.371 seconds 2019-04-14 19:59:05 x.x.x.x:3908 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 3000/3000 bytes tx 1982/1982 bytes rx 1.817 seconds 2019-04-14 19:59:16 x.x.x.x:3911 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 137/137 bytes tx 1085/1085 bytes rx 11.867 seconds 2019-04-14 19:59:16 x.x.x.x:3914 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 137/137 bytes tx 1085/1085 bytes rx 11.514 seconds 2019-04-14 19:59:37 x.x.x.x:3792 -> 10.0.0.4:443 -> 208.111.155.170:443 [1.viki.io] 5486/5486 bytes tx 1625/1625 bytes rx 75.375 seconds 2019-04-14 19:59:50 x.x.x.x:3839 -> 10.0.0.4:443 -> 208.111.155.170:443 [0.viki.io] 11417/11417 bytes tx 1594/1594 bytes rx 75.386 seconds 2019-04-14 19:59:50 x.x.x.x:3840 -> 10.0.0.4:443 -> 208.111.155.170:443 [0.viki.io] 6178/6178 bytes tx 1602/1602 bytes rx 75.385 seconds 2019-04-14 19:59:50 x.x.x.x:3838 -> 10.0.0.4:443 -> 208.111.155.170:443 [0.viki.io] 6960/6960 bytes tx 1600/1600 bytes rx 75.387 seconds 2019-04-14 19:59:50 x.x.x.x:4040 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 137/137 bytes tx 1085/1085 bytes rx 16.157 seconds 2019-04-14 20:00:08 x.x.x.x:3791 -> 10.0.0.4:443 -> 50.17.61.45:443 [colvk.viki.io] 17691/17691 bytes tx 28506/28506 bytes rx 105.803 seconds 2019-04-14 20:00:24 x.x.x.x:4030 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 2322/2322 bytes tx 1566/1566 bytes rx 50.715 seconds 2019-04-14 20:00:25 x.x.x.x:3770 -> 10.0.0.4:443 -> 35.230.66.230:443 [www.viki.com] 133854/133854 bytes tx 35163/35163 bytes rx 125.650 seconds 2019-04-14 20:00:42 x.x.x.x:3790 -> 10.0.0.4:443 -> 35.197.147.29:443 [api.viki.io] 43579/43579 bytes tx 10495/10495 bytes rx 140.467 seconds

There are no errors within the error logs.

I'm suspecting there may be difference in some headers with the web debugging proxy stripping or adding something to the requests. But I have not debugged further. Wonder if you might know what's going on?