mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
649 B
31 lines
649 B
package transport
|
|
|
|
import "github.com/v2ray/v2ray-core/transport/hub/kcpv"
|
|
|
|
// Config for V2Ray transport layer.
|
|
type Config struct {
|
|
ConnectionReuse bool
|
|
enableKcp bool
|
|
kcpConfig *kcpv.Config
|
|
}
|
|
|
|
// Apply applies this Config.
|
|
func (this *Config) Apply() error {
|
|
if this.ConnectionReuse {
|
|
connectionReuse = true
|
|
}
|
|
enableKcp = this.enableKcp
|
|
if enableKcp {
|
|
KcpConfig = this.kcpConfig
|
|
/*
|
|
KCP do not support connectionReuse,
|
|
it is mandatory to set connectionReuse to false
|
|
Since KCP have no handshake and
|
|
does not SlowStart, there isn't benefit to
|
|
use that anyway.
|
|
*/
|
|
connectionReuse = false
|
|
}
|
|
return nil
|
|
}
|