transport.go 413 B

12345678910111213141516171819202122
  1. package transport
  2. import "github.com/v2ray/v2ray-core/common/log"
  3. var (
  4. TCPStreamConfig = &TCPConfig{
  5. ConnectionReuse: false,
  6. }
  7. )
  8. func ApplyConfig(config *Config) error {
  9. if config.StreamType == StreamTypeTCP {
  10. if config.TCPConfig != nil {
  11. TCPStreamConfig = config.TCPConfig
  12. if config.TCPConfig.ConnectionReuse {
  13. log.Info("Transport: TCP connection reuse enabled.")
  14. }
  15. }
  16. }
  17. return nil
  18. }