From 95f955988554a2f2da7a2bf87aab8909173c0525 Mon Sep 17 00:00:00 2001 From: Or Ozeri Date: Fri, 1 Mar 2024 05:48:11 +0200 Subject: [PATCH] tcpproxy: Increase reader buffer size Fixes: #40 Signed-off-by: Or Ozeri --- tcpproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpproxy.go b/tcpproxy.go index 1f03e32..896e1fd 100644 --- a/tcpproxy.go +++ b/tcpproxy.go @@ -223,7 +223,7 @@ func (p *Proxy) serveListener(ret chan<- error, ln net.Listener, routes []route) // serveConn runs in its own goroutine and matches c against routes. // It returns whether it matched purely for testing. func (p *Proxy) serveConn(c net.Conn, routes []route) bool { - br := bufio.NewReader(c) + br := bufio.NewReaderSize(c, 65536) for _, route := range routes { if target, hostName := route.match(br); target != nil { if n := br.Buffered(); n > 0 {