inbound_detour.go 670 B

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