json.go 955 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package json
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/common/net"
  4. v2netjson "github.com/v2ray/v2ray-core/common/net/json"
  5. "github.com/v2ray/v2ray-core/proxy/internal/config"
  6. "github.com/v2ray/v2ray-core/proxy/internal/config/json"
  7. )
  8. type DokodemoConfig struct {
  9. Host *v2netjson.Host `json:"address"`
  10. PortValue v2net.Port `json:"port"`
  11. NetworkList *v2netjson.NetworkList `json:"network"`
  12. TimeoutValue int `json:"timeout"`
  13. }
  14. func (this *DokodemoConfig) Address() v2net.Address {
  15. return this.Host.Address()
  16. }
  17. func (this *DokodemoConfig) Port() v2net.Port {
  18. return this.PortValue
  19. }
  20. func (this *DokodemoConfig) Network() v2net.NetworkList {
  21. return this.NetworkList
  22. }
  23. func (this *DokodemoConfig) Timeout() int {
  24. return this.TimeoutValue
  25. }
  26. func init() {
  27. config.RegisterInboundConnectionConfig("dokodemo-door", json.JsonConfigLoader(func() interface{} {
  28. return new(DokodemoConfig)
  29. }))
  30. }