mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 08:31:28 +00:00
Fix HTTPUpgrade init
This commit is contained in:
parent
548646fb06
commit
021868afca
|
@ -58,6 +58,8 @@ func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: Each new transport needs to add init() func in transport/internet/xxx/config.go
|
||||||
|
// Otherwise, it will cause #3244
|
||||||
func CreateTransportConfig(name string) (interface{}, error) {
|
func CreateTransportConfig(name string) (interface{}, error) {
|
||||||
creator, ok := globalTransportConfigCreatorCache[name]
|
creator, ok := globalTransportConfigCreatorCache[name]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
package httpupgrade
|
package httpupgrade
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/xtls/xray-core/common"
|
||||||
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
|
)
|
||||||
|
|
||||||
func (c *Config) GetNormalizedPath() string {
|
func (c *Config) GetNormalizedPath() string {
|
||||||
path := c.Path
|
path := c.Path
|
||||||
if path == "" {
|
if path == "" {
|
||||||
|
@ -10,3 +15,9 @@ func (c *Config) GetNormalizedPath() string {
|
||||||
}
|
}
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
||||||
|
return new(Config)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue