set "happy-eyeballs" enabled by default

This commit is contained in:
patterniha 2025-04-30 01:35:24 +03:30
parent 5840907b24
commit e702c9534f
2 changed files with 8 additions and 8 deletions

View File

@ -818,7 +818,7 @@ func (c *SocketConfig) Build() (*internet.SocketConfig, error) {
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 {
happyEyeballs.Enabled = c.HappyEyeballsSettings.Enabled
happyEyeballs.PrioritizeIpv6 = c.HappyEyeballsSettings.PrioritizeIPv6

View File

@ -26,7 +26,7 @@ func TestSocketConfig(t *testing.T) {
Tfo: 256,
DomainStrategy: internet.DomainStrategy_USE_IP,
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{
{
@ -48,7 +48,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 0,
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{
{
@ -67,7 +67,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 0,
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{
{
@ -86,7 +86,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 0,
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{
{
@ -105,7 +105,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 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{
{
@ -124,7 +124,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 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{
{
@ -141,7 +141,7 @@ func TestSocketConfig(t *testing.T) {
expectedOutput = &internet.SocketConfig{
Mark: 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{
{