dns

package
v0.0.0-...-876fa33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RuleAction_name = map[int32]string{
		0: "Direct",
		1: "Drop",
		2: "Reject",
		3: "Hijack",
	}
	RuleAction_value = map[string]int32{
		"Direct": 0,
		"Drop":   1,
		"Reject": 2,
		"Hijack": 3,
	}
)

Enum value maps for RuleAction.

View Source
var File_proxy_dns_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config

type Config struct {
	UserLevel uint32           `protobuf:"varint,1,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
	Rule      []*DNSRuleConfig `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"`
	Server    *net.Endpoint    `protobuf:"bytes,3,opt,name=server,proto3" json:"server,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetRule

func (x *Config) GetRule() []*DNSRuleConfig

func (*Config) GetServer

func (x *Config) GetServer() *net.Endpoint

func (*Config) GetUserLevel

func (x *Config) GetUserLevel() uint32

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type DNSRule

type DNSRule struct {
	// contains filtered or unexported fields
}

func (*DNSRule) Apply

func (r *DNSRule) Apply(qType uint16, domain string) bool

type DNSRuleConfig

type DNSRuleConfig struct {
	Action RuleAction            `protobuf:"varint,1,opt,name=action,proto3,enum=xray.proxy.dns.RuleAction" json:"action,omitempty"`
	Qtype  []int32               `protobuf:"varint,2,rep,packed,name=qtype,proto3" json:"qtype,omitempty"`
	Domain []*geodata.DomainRule `protobuf:"bytes,3,rep,name=domain,proto3" json:"domain,omitempty"`
	// contains filtered or unexported fields
}

func (*DNSRuleConfig) Descriptor deprecated

func (*DNSRuleConfig) Descriptor() ([]byte, []int)

Deprecated: Use DNSRuleConfig.ProtoReflect.Descriptor instead.

func (*DNSRuleConfig) GetAction

func (x *DNSRuleConfig) GetAction() RuleAction

func (*DNSRuleConfig) GetDomain

func (x *DNSRuleConfig) GetDomain() []*geodata.DomainRule

func (*DNSRuleConfig) GetQtype

func (x *DNSRuleConfig) GetQtype() []int32

func (*DNSRuleConfig) ProtoMessage

func (*DNSRuleConfig) ProtoMessage()

func (*DNSRuleConfig) ProtoReflect

func (x *DNSRuleConfig) ProtoReflect() protoreflect.Message

func (*DNSRuleConfig) Reset

func (x *DNSRuleConfig) Reset()

func (*DNSRuleConfig) String

func (x *DNSRuleConfig) String() string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) Init

func (h *Handler) Init(config *Config, dnsClient dns.Client, policyManager policy.Manager) error

func (*Handler) Process

func (h *Handler) Process(ctx context.Context, link *transport.Link, d internet.Dialer) error

Process implements proxy.Outbound.

type RuleAction

type RuleAction int32
const (
	RuleAction_Direct RuleAction = 0
	RuleAction_Drop   RuleAction = 1
	RuleAction_Reject RuleAction = 2
	RuleAction_Hijack RuleAction = 3
)

func (RuleAction) Descriptor

func (RuleAction) Descriptor() protoreflect.EnumDescriptor

func (RuleAction) Enum

func (x RuleAction) Enum() *RuleAction

func (RuleAction) EnumDescriptor deprecated

func (RuleAction) EnumDescriptor() ([]byte, []int)

Deprecated: Use RuleAction.Descriptor instead.

func (RuleAction) Number

func (x RuleAction) Number() protoreflect.EnumNumber

func (RuleAction) String

func (x RuleAction) String() string

func (RuleAction) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL