2026-09-24 10:13:37 +08:00
|
|
|
package masque
|
|
|
|
|
|
|
|
|
|
import (
|
2026-10-12 23:10:04 +03:30
|
|
|
"time"
|
|
|
|
|
|
2026-09-24 10:13:37 +08:00
|
|
|
"github.com/xtls/xray-core/common"
|
|
|
|
|
"github.com/xtls/xray-core/transport/internet"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const protocolName = "masque"
|
|
|
|
|
|
|
|
|
|
const DefaultPath = "/.well-known/masque/ip/*/*/"
|
|
|
|
|
|
2026-10-12 23:10:04 +03:30
|
|
|
func (c *Config) keepAlivePeriod() time.Duration {
|
|
|
|
|
if c.Xmux == nil {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
return time.Duration(c.Xmux.HKeepAlivePeriod) * time.Second
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-24 10:13:37 +08:00
|
|
|
func init() {
|
|
|
|
|
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
|
|
|
|
return &Config{
|
|
|
|
|
Path: DefaultPath,
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
}
|