diff --git a/internal/server/dispatcher.go b/internal/server/dispatcher.go index 4285ed3..2633030 100644 --- a/internal/server/dispatcher.go +++ b/internal/server/dispatcher.go @@ -20,6 +20,8 @@ import ( var b64 = base64.StdEncoding.EncodeToString +const firstPacketSize = 3000 + func Serve(l net.Listener, sta *State) { waitDur := [10]time.Duration{ 50 * time.Millisecond, 100 * time.Millisecond, 300 * time.Millisecond, 500 * time.Millisecond, 1 * time.Second, @@ -124,7 +126,7 @@ func readFirstPacket(conn net.Conn, buf []byte, timeout time.Duration) (int, Tra func dispatchConnection(conn net.Conn, sta *State) { var err error - buf := make([]byte, 1500) + buf := make([]byte, firstPacketSize) i, transport, redirOnErr, err := readFirstPacket(conn, buf, 15*time.Second) data := buf[:i]