config.go 405 B

123456789101112131415161718192021
  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. this.kcpConfig.Apply()
  17. return nil
  18. }