config.go 405 B

1234567891011121314151617181920212223
  1. package websocket
  2. import (
  3. "v2ray.com/core/common"
  4. "v2ray.com/core/transport/internet"
  5. )
  6. func (c *Config) GetNormailzedPath() string {
  7. path := c.Path
  8. if len(path) == 0 {
  9. return "/"
  10. }
  11. if path[0] != '/' {
  12. return "/" + path
  13. }
  14. return path
  15. }
  16. func init() {
  17. common.Must(internet.RegisterProtocolConfigCreator(internet.TransportProtocol_WebSocket, func() interface{} {
  18. return new(Config)
  19. }))
  20. }