mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-14 05:04:12 +08:00
set "happy-eyeballs" enabled by default
This commit is contained in:
parent
5840907b24
commit
e702c9534f
@ -818,7 +818,7 @@ func (c *SocketConfig) Build() (*internet.SocketConfig, error) {
|
|||||||
return nil, errors.New("unsupported address and port strategy: ", c.AddressPortStrategy)
|
return nil, errors.New("unsupported address and port strategy: ", c.AddressPortStrategy)
|
||||||
}
|
}
|
||||||
|
|
||||||
var happyEyeballs = &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, PrioritizeIpv6: false, TryDelayMs: 250, MaxConcurrentTry: 4}
|
var happyEyeballs = &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, PrioritizeIpv6: false, TryDelayMs: 250, MaxConcurrentTry: 4}
|
||||||
if c.HappyEyeballsSettings != nil {
|
if c.HappyEyeballsSettings != nil {
|
||||||
happyEyeballs.Enabled = c.HappyEyeballsSettings.Enabled
|
happyEyeballs.Enabled = c.HappyEyeballsSettings.Enabled
|
||||||
happyEyeballs.PrioritizeIpv6 = c.HappyEyeballsSettings.PrioritizeIPv6
|
happyEyeballs.PrioritizeIpv6 = c.HappyEyeballsSettings.PrioritizeIPv6
|
||||||
|
@ -26,7 +26,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
Tfo: 256,
|
Tfo: 256,
|
||||||
DomainStrategy: internet.DomainStrategy_USE_IP,
|
DomainStrategy: internet.DomainStrategy_USE_IP,
|
||||||
DialerProxy: "tag",
|
DialerProxy: "tag",
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: -1,
|
Tfo: -1,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: 65535,
|
Tfo: 65535,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: -65535,
|
Tfo: -65535,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -105,7 +105,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: 0,
|
Tfo: 0,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: 0,
|
Tfo: 0,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
@ -141,7 +141,7 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
expectedOutput = &internet.SocketConfig{
|
expectedOutput = &internet.SocketConfig{
|
||||||
Mark: 0,
|
Mark: 0,
|
||||||
Tfo: 0,
|
Tfo: 0,
|
||||||
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: false, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
HappyEyeballs: &internet.HappyEyeballsConfig{Enabled: true, Interleave: 1, TryDelayMs: 250, PrioritizeIpv6: false, MaxConcurrentTry: 4},
|
||||||
}
|
}
|
||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user