inbound_detour.go 864 B

1234567891011121314151617181920212223242526272829303132
  1. package json
  2. import (
  3. "encoding/json"
  4. v2net "github.com/v2ray/v2ray-core/common/net"
  5. v2netjson "github.com/v2ray/v2ray-core/common/net/json"
  6. proxyconfig "github.com/v2ray/v2ray-core/proxy/common/config"
  7. )
  8. type InboundDetourConfig struct {
  9. ProtocolValue string `json:"protocol"`
  10. PortRangeValue *v2netjson.PortRange `json:"port"`
  11. SettingsValue json.RawMessage `json:"settings"`
  12. TagValue string `json:"tag"`
  13. }
  14. func (this *InboundDetourConfig) Protocol() string {
  15. return this.ProtocolValue
  16. }
  17. func (this *InboundDetourConfig) PortRange() v2net.PortRange {
  18. return this.PortRangeValue
  19. }
  20. func (this *InboundDetourConfig) Settings() interface{} {
  21. return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeInbound)
  22. }
  23. func (this *InboundDetourConfig) Tag() string {
  24. return this.TagValue
  25. }