Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/klzgrad/naiveproxy/llms.txt

Use this file to discover all available pages before exploring further.

NaïveProxy relies on Chromium’s HTTP/2 network stack, which means its performance characteristics are closely tied to the underlying TCP implementation and browser configuration. The defaults work well for most users, but high-bandwidth or high-latency links — and heavy multi-tab browsing — benefit from targeted tuning of kernel parameters and Chromium policy settings.

Linux Kernel TCP Tuning

TCP throughput over a high-latency link is bounded by the receive window: throughput ≤ window size ÷ RTT. The Linux defaults (3 MB max receive window, 2 MB max send window) are sufficient for typical home connections but become a bottleneck on fat links — for example, a 1 Gbps connection with more than 16 ms RTT. The correct target is the bandwidth-delay product (BDP):
BDP = Link speed × RTT
For a 1 Gbps link with 256 ms RTT, BDP = 32 MiB, which requires a 64 MiB maximum buffer. Tune /etc/sysctl.conf accordingly:
# Client only — tune the receive window:
net.ipv4.tcp_rmem = 4096 131072 67108864

# Server only — tune the send window:
net.ipv4.tcp_wmem = 4096 131072 67108864
Add the appropriate line for your role (client or server) to /etc/sysctl.conf, then apply with sudo sysctl -p. BBR congestion control (see below) can also auto-tune window size to reduce bufferbloat.

Enable BBR Congestion Control

BBR replaces the default loss-based congestion control with a model-based algorithm that tracks bandwidth and round-trip time directly. This significantly reduces bufferbloat and improves throughput on congested or high-latency paths.
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr
To make this permanent, add net.ipv4.tcp_congestion_control=bbr to /etc/sysctl.conf.
NaïveProxy uses HTTP/2, which multiplexes all streams over a single TCP connection per host. This means TCP-level tuning has a direct and outsized impact on overall proxy throughput — there is no second connection to spread the load.

Disable tcp_slow_start_after_idle

By default, Linux resets the TCP congestion window to its initial value after a period of inactivity. Because NaïveProxy uses a persistent single connection, this causes unnecessary throughput degradation each time the connection is briefly idle between requests.
sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0
This provides a small but consistent improvement for persistent connection performance. Add net.ipv4.tcp_slow_start_after_idle=0 to /etc/sysctl.conf to persist across reboots.

(Server Only) Consider tcp_notsent_lowat

tcp_notsent_lowat controls the threshold of unsent bytes in the kernel send buffer below which a socket is considered writable. Lowering it reduces the amount of data queued ahead of transmission, which can improve interactive latency for multiplexed connections.
sudo sysctl -w net.ipv4.tcp_notsent_lowat=131072
Common values range from 16 KB to 128 KB.
Setting tcp_notsent_lowat to a very small value increases server CPU usage and can hurt throughput under heavy load. This parameter applies system-wide to all applications on the server, not just NaïveProxy. Benchmark your workload carefully before deploying this change in production.

Do NOT Enable TCP Fast Open

Do not enable TCP Fast Open (net.ipv4.tcp_fastopen) for NaïveProxy traffic. The Linux kernel implementation is too conservative to provide meaningful latency gains, and its rare usage creates a distinguishable traffic feature that undermines NaïveProxy’s camouflage goals. Leave this setting at its default.

Chromium Browser Configuration

Chromium limits the number of simultaneous connections to any single proxy to 32. When browsing with many tabs open, this ceiling is often reached and new requests queue behind existing ones. You can raise it by deploying a managed policy. The maximum allowed value for MaxConnectionsPerProxy is 99. Even at 99, the limit can still be too low for heavy browsing — consider installing an ad-blocker to reduce the total number of requests and keep connection usage within bounds.
Create a managed policy directory and write the policy JSON:
sudo mkdir -p /etc/chromium/policies/managed
echo '{ "MaxConnectionsPerProxy": 99 }' | sudo tee /etc/chromium/policies/managed/proxy.json
Restart Chromium, then navigate to chrome://policy to confirm the policy is active.

Build docs developers (and LLMs) love