json.go 875 B

123456789101112131415161718192021222324252627282930313233343536
  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/common/config/json"
  6. )
  7. type DokodemoConfig struct {
  8. Host *v2netjson.Host `json:"address"`
  9. PortValue v2net.Port `json:"port"`
  10. NetworkList *v2netjson.NetworkList `json:"network"`
  11. TimeoutValue int `json:"timeout"`
  12. }
  13. func (this *DokodemoConfig) Address() v2net.Address {
  14. return this.Host.Address()
  15. }
  16. func (this *DokodemoConfig) Port() v2net.Port {
  17. return this.PortValue
  18. }
  19. func (this *DokodemoConfig) Network() v2net.NetworkList {
  20. return this.NetworkList
  21. }
  22. func (this *DokodemoConfig) Timeout() int {
  23. return this.TimeoutValue
  24. }
  25. func init() {
  26. json.RegisterInboundConnectionConfig("dokodemo-door", func() interface{} {
  27. return new(DokodemoConfig)
  28. })
  29. }