config.go 534 B

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