config.go 422 B

12345678910111213141516171819202122
  1. package transport
  2. import "github.com/v2ray/v2ray-core/transport/hub/kcpv"
  3. // Config for V2Ray transport layer.
  4. type Config struct {
  5. ConnectionReuse bool
  6. enableKcp bool
  7. kcpConfig *kcpv.Config
  8. }
  9. // Apply applies this Config.
  10. func (this *Config) Apply() error {
  11. if this.ConnectionReuse {
  12. connectionReuse = true
  13. }
  14. enableKcp = this.enableKcp
  15. if enableKcp {
  16. KcpConfig = this.kcpConfig
  17. }
  18. return nil
  19. }