mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 04:38:28 +10:00
- Set QUIC InitialPacketSize per IP family (IPv4: 1252, IPv6: 1232) - Set MaxIncomingStreams/MaxIncomingUniStreams to 1<<60 - Populate OriginLocalIP from local socket address in both QUIC and HTTP/2 - Pass NumPreviousAttempts from retry counter to registration - Include version number in client version string - Use OS_GOARCH format for Arch field
26 lines
643 B
Go
26 lines
643 B
Go
//go:build with_cloudflare_tunnel
|
|
|
|
package cloudflare
|
|
|
|
import "testing"
|
|
|
|
func TestQUICInitialPacketSize(t *testing.T) {
|
|
testCases := []struct {
|
|
name string
|
|
ipVersion int
|
|
expected uint16
|
|
}{
|
|
{name: "ipv4", ipVersion: 4, expected: 1232},
|
|
{name: "ipv6", ipVersion: 6, expected: 1252},
|
|
{name: "default", ipVersion: 0, expected: 1252},
|
|
}
|
|
|
|
for _, testCase := range testCases {
|
|
t.Run(testCase.name, func(t *testing.T) {
|
|
if actual := quicInitialPacketSize(testCase.ipVersion); actual != testCase.expected {
|
|
t.Fatalf("quicInitialPacketSize(%d) = %d, want %d", testCase.ipVersion, actual, testCase.expected)
|
|
}
|
|
})
|
|
}
|
|
}
|