outbound_detour.go 677 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 OutboundDetourConfig struct {
  8. ProtocolValue string `json:"protocol"`
  9. TagValue string `json:"tag"`
  10. SettingsValue json.RawMessage `json:"settings"`
  11. }
  12. func (this *OutboundDetourConfig) Protocol() string {
  13. return this.ProtocolValue
  14. }
  15. func (this *OutboundDetourConfig) Tag() config.DetourTag {
  16. return config.DetourTag(this.TagValue)
  17. }
  18. func (this *OutboundDetourConfig) Settings() interface{} {
  19. return loadConnectionConfig(this.SettingsValue, this.ProtocolValue, proxyconfig.TypeOutbound)
  20. }