mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-14 01:59:09 +03:00
https://github.com/XTLS/Xray-core/pull/6810#issuecomment-5842441136 https://github.com/XTLS/Xray-core/pull/6878#issuecomment-6095112915 https://github.com/XTLS/Xray-core/pull/7121#issuecomment-6117636043 --------- Co-authored-by: SVLAVR <skugorov.s@gmail.com>
28 lines
504 B
Go
28 lines
504 B
Go
package masque
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/xtls/xray-core/common"
|
|
"github.com/xtls/xray-core/transport/internet"
|
|
)
|
|
|
|
const protocolName = "masque"
|
|
|
|
const DefaultPath = "/.well-known/masque/ip/*/*/"
|
|
|
|
func (c *Config) keepAlivePeriod() time.Duration {
|
|
if c.Xmux == nil {
|
|
return 0
|
|
}
|
|
return time.Duration(c.Xmux.HKeepAlivePeriod) * time.Second
|
|
}
|
|
|
|
func init() {
|
|
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
|
return &Config{
|
|
Path: DefaultPath,
|
|
}
|
|
}))
|
|
}
|