config.go 401 B

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