mirror of https://github.com/v2ray/v2ray-core
parent
77eee3ed37
commit
a8792b2b60
@ -1,12 +1,20 @@
|
||||
package transport
|
||||
|
||||
import "github.com/v2ray/v2ray-core/transport/hub/kcpv"
|
||||
|
||||
type Config struct {
|
||||
ConnectionReuse bool
|
||||
enableKcp bool
|
||||
kcpConfig *kcpv.Config
|
||||
}
|
||||
|
||||
func (this *Config) Apply() error {
|
||||
if this.ConnectionReuse {
|
||||
connectionReuse = true
|
||||
}
|
||||
enableKcp = this.enableKcp
|
||||
if enableKcp {
|
||||
KcpConfig = this.kcpConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -1,9 +1,17 @@
|
||||
package transport
|
||||
|
||||
import "github.com/v2ray/v2ray-core/transport/hub/kcpv"
|
||||
|
||||
var (
|
||||
connectionReuse = true
|
||||
enableKcp = false
|
||||
KcpConfig *kcpv.Config
|
||||
)
|
||||
|
||||
func IsConnectionReusable() bool {
|
||||
return connectionReuse
|
||||
}
|
||||
|
||||
func IsKcpEnabled() bool {
|
||||
return enableKcp
|
||||
}
|
||||
|
Loading…
Reference in new issue