inbound_detour.go 741 B

123456789101112131415161718192021222324252627
  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. }
  13. func (this *InboundDetourConfig) Protocol() string {
  14. return this.ProtocolValue
  15. }
  16. func (this *InboundDetourConfig) PortRange() v2net.PortRange {
  17. return this.PortRangeValue
  18. }
  19. func (this *InboundDetourConfig) Settings() interface{} {
  20. return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeInbound)
  21. }