#904·gost

sni handler: connections dropped after exactly 15s (readTimeout deadline applied to entire session)

Author: madCreated Sep 11, 2026Updated Sep 12, 2026

Version: gost 3.3.0 (go-gost/x, commit 4d4690b)

Repro: gost -L=sni://:443 -F=ss://aes-256-gcm:pass@upstream:10098 Any TCP connection through the SNI proxy that lives longer than 15s is reset, even with active traffic.

Cause: commit 4d4690b moved the read deadline reset into defer, so the 15s readTimeout deadline set before sniffing now stays on the client connection for the whole session. xnet.Pipe reads fail with os.ErrDeadlineExceeded at T0+15s. Note: handler/forward had the same bug and was fixed in 722dde5 ("to prevent 15s download abort") by splitting readTimeout from idleTimeout — sni was missed.

Expected: deadline scoped to the ClientHello sniffing phase only (as before commit 4d4690b), or readTimeout<=0 truly disabling the timeout.

Workaround: -L "sni://:443?readTimeout=87600h"