high85%
Next.js testProxy breaks fetch to HTTP/2 servers due to ALPN mismatch
When experimental.testProxy is enabled, the global socket interceptor from @mswjs/interceptors patches net.Socket.prototype.connect for all outbound sockets, including fetch/undici. In passthrough mode (no active test context), it opens a real TLS socket copying the original ALPN list. If the server negotiates HTTP/2, the interceptor still writes HTTP/1.1 plaintext and parses the response with an HTTP/1.1 parser, causing fetch failures.
