2016-12-22 23:30:46 +00:00
|
|
|
package websocket
|
2016-08-13 13:44:36 +00:00
|
|
|
|
2016-10-02 21:43:58 +00:00
|
|
|
import (
|
2017-01-12 11:54:34 +00:00
|
|
|
"v2ray.com/core/common"
|
2016-10-02 21:43:58 +00:00
|
|
|
"v2ray.com/core/transport/internet"
|
2016-08-13 13:44:36 +00:00
|
|
|
)
|
2016-10-02 21:43:58 +00:00
|
|
|
|
2017-02-10 10:47:53 +00:00
|
|
|
func (c *Config) GetNormailzedPath() string {
|
|
|
|
path := c.Path
|
|
|
|
if len(path) == 0 {
|
|
|
|
return "/"
|
|
|
|
}
|
|
|
|
if path[0] != '/' {
|
|
|
|
return "/" + path
|
|
|
|
}
|
|
|
|
return path
|
|
|
|
}
|
|
|
|
|
2016-10-02 21:43:58 +00:00
|
|
|
func init() {
|
2017-01-12 11:54:34 +00:00
|
|
|
common.Must(internet.RegisterProtocolConfigCreator(internet.TransportProtocol_WebSocket, func() interface{} {
|
2016-10-02 21:43:58 +00:00
|
|
|
return new(Config)
|
2017-01-12 11:54:34 +00:00
|
|
|
}))
|
2016-10-02 21:43:58 +00:00
|
|
|
}
|