github.com/xmplusdev/xray-core@v1.8.10/app/proxyman/config.go (about)

     1  package proxyman
     2  
     3  func (s *AllocationStrategy) GetConcurrencyValue() uint32 {
     4  	if s == nil || s.Concurrency == nil {
     5  		return 3
     6  	}
     7  	return s.Concurrency.Value
     8  }
     9  
    10  func (s *AllocationStrategy) GetRefreshValue() uint32 {
    11  	if s == nil || s.Refresh == nil {
    12  		return 5
    13  	}
    14  	return s.Refresh.Value
    15  }
    16  
    17  func (c *ReceiverConfig) GetEffectiveSniffingSettings() *SniffingConfig {
    18  	if c.SniffingSettings != nil {
    19  		return c.SniffingSettings
    20  	}
    21  
    22  	if len(c.DomainOverride) > 0 {
    23  		var p []string
    24  		for _, kd := range c.DomainOverride {
    25  			switch kd {
    26  			case KnownProtocols_HTTP:
    27  				p = append(p, "http")
    28  			case KnownProtocols_TLS:
    29  				p = append(p, "tls")
    30  			}
    31  		}
    32  		return &SniffingConfig{
    33  			Enabled:             true,
    34  			DestinationOverride: p,
    35  		}
    36  	}
    37  
    38  	return nil
    39  }