mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-19 06:39:48 +03:00
New feature: Happy Eyeballs (RFC 8305) (#4667)
Closes https://github.com/XTLS/Xray-core/issues/4473
This commit is contained in:
@ -26,6 +26,7 @@ func TestSocketConfig(t *testing.T) {
|
||||
Tfo: 256,
|
||||
DomainStrategy: internet.DomainStrategy_USE_IP,
|
||||
DialerProxy: "tag",
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -45,8 +46,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test "tcpFastOpen": false, disabled TFO is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: -1,
|
||||
Mark: 0,
|
||||
Tfo: -1,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -63,8 +65,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test "tcpFastOpen": 65535, queue length 65535 is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: 65535,
|
||||
Mark: 0,
|
||||
Tfo: 65535,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -81,8 +84,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test "tcpFastOpen": -65535, disable TFO is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: -65535,
|
||||
Mark: 0,
|
||||
Tfo: -65535,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -99,8 +103,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test "tcpFastOpen": 0, no operation is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -117,8 +122,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test omit "tcpFastOpen", no operation is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@ -133,8 +139,9 @@ func TestSocketConfig(t *testing.T) {
|
||||
|
||||
// test "tcpFastOpen": null, no operation is expected
|
||||
expectedOutput = &internet.SocketConfig{
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
Mark: 0,
|
||||
Tfo: 0,
|
||||
HappyEyeballs: &internet.HappyEyeballsConfig{Interleave: 1, TryDelayMs: 0, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||
}
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
|
Reference in New Issue
Block a user