2016-06-01 19:49:25 -04:00
|
|
|
package transport
|
|
|
|
|
2016-06-14 16:54:08 -04:00
|
|
|
import (
|
|
|
|
"github.com/v2ray/v2ray-core/transport/internet/kcp"
|
|
|
|
"github.com/v2ray/v2ray-core/transport/internet/tcp"
|
|
|
|
)
|
2016-06-11 07:51:02 -04:00
|
|
|
|
2016-06-11 07:29:33 -04:00
|
|
|
// Config for V2Ray transport layer.
|
2016-06-02 14:52:52 -04:00
|
|
|
type Config struct {
|
2016-06-14 16:54:08 -04:00
|
|
|
tcpConfig *tcp.Config
|
|
|
|
kcpConfig *kcp.Config
|
2016-06-01 19:49:25 -04:00
|
|
|
}
|
|
|
|
|
2016-06-11 07:29:33 -04:00
|
|
|
// Apply applies this Config.
|
2016-06-02 14:52:52 -04:00
|
|
|
func (this *Config) Apply() error {
|
2016-06-14 16:54:08 -04:00
|
|
|
if this.tcpConfig != nil {
|
|
|
|
this.tcpConfig.Apply()
|
2016-06-02 14:52:52 -04:00
|
|
|
}
|
2016-06-14 16:54:08 -04:00
|
|
|
if this.kcpConfig != nil {
|
|
|
|
this.kcpConfig.Apply()
|
2016-06-11 07:51:02 -04:00
|
|
|
}
|
2016-06-02 14:52:52 -04:00
|
|
|
return nil
|
2016-06-01 19:49:25 -04:00
|
|
|
}
|