config.go 438 B

1234567891011121314151617181920212223
  1. package transport
  2. import (
  3. "github.com/v2ray/v2ray-core/transport/internet/kcp"
  4. "github.com/v2ray/v2ray-core/transport/internet/tcp"
  5. )
  6. // Config for V2Ray transport layer.
  7. type Config struct {
  8. tcpConfig *tcp.Config
  9. kcpConfig *kcp.Config
  10. }
  11. // Apply applies this Config.
  12. func (this *Config) Apply() error {
  13. if this.tcpConfig != nil {
  14. this.tcpConfig.Apply()
  15. }
  16. if this.kcpConfig != nil {
  17. this.kcpConfig.Apply()
  18. }
  19. return nil
  20. }