1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
v2fly/transport/config.go

27 lines
534 B
Go
Raw Normal View History

2016-06-02 01:49:25 +02:00
package transport
2016-06-14 22:54:08 +02:00
import (
"github.com/v2ray/v2ray-core/transport/internet/kcp"
"github.com/v2ray/v2ray-core/transport/internet/tcp"
2016-08-13 21:37:17 +08:00
"github.com/v2ray/v2ray-core/transport/internet/ws"
2016-06-14 22:54:08 +02:00
)
2016-06-11 19:51:02 +08:00
2016-06-11 13:29:33 +02:00
// Config for V2Ray transport layer.
2016-06-02 20:52:52 +02:00
type Config struct {
2016-06-14 22:54:08 +02:00
tcpConfig *tcp.Config
2016-06-17 16:57:48 +02:00
kcpConfig kcp.Config
2016-08-13 21:37:17 +08:00
wsConfig *ws.Config
2016-06-02 01:49:25 +02:00
}
2016-06-11 13:29:33 +02:00
// Apply applies this Config.
2016-06-02 20:52:52 +02:00
func (this *Config) Apply() error {
2016-06-14 22:54:08 +02:00
if this.tcpConfig != nil {
this.tcpConfig.Apply()
2016-06-02 20:52:52 +02:00
}
2016-06-17 16:57:48 +02:00
this.kcpConfig.Apply()
2016-08-13 21:37:17 +08:00
if this.wsConfig != nil {
this.wsConfig.Apply()
}
2016-06-02 20:52:52 +02:00
return nil
2016-06-02 01:49:25 +02:00
}