1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-29 18:45:23 +00:00
v2fly/transport/config.go

27 lines
495 B
Go
Raw Normal View History

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