Xray-core/transport/internet/httpupgrade/config.go

24 lines
401 B
Go
Raw Normal View History

2024-03-03 05:12:38 +00:00
package httpupgrade
2024-04-07 15:53:34 +00:00
import (
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/transport/internet"
)
2024-03-03 05:12:38 +00:00
func (c *Config) GetNormalizedPath() string {
path := c.Path
if path == "" {
return "/"
}
if path[0] != '/' {
return "/" + path
}
return path
}
2024-04-07 15:53:34 +00:00
func init() {
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
return new(Config)
}))
}