Versions in this module Expand all Collapse all v1 v1.16.4 Nov 2, 2023 v1.16.3 Oct 20, 2023 v1.16.2 Oct 20, 2023 Changes in this version + const BpfFSPath + const ClashTrafficMark + const DefaultMaxHealthCheckUrlNum + const DefaultTCPTimeout + const DefaultTLSTimeout + const DefaultUDPTimeout + const Name + const TcpAutoRedirPort + var BuildTime = "unknown time" + var ClashName = "clash.meta" + var DNSModeMapping = map[string]DNSMode + var ErrNotSupport = errors.New("no support") + var GeoIpUrl string + var GeoSiteUrl string + var GeodataMode bool + var GeoipName = "GeoIP.dat" + var GeositeName = "GeoSite.dat" + var Meta = true + var MmdbUrl string + var Path = func() *path { ... }() + var StackTypeMapping = map[string]TUNStack + var UA string + var Version = "1.10.0" + func SetConfig(file string) + func SetHomeDir(root string) + type AdapterType int + const Compatible + const Direct + const Fallback + const Http + const Hysteria + const Hysteria2 + const LoadBalance + const Pass + const Reject + const Relay + const Selector + const Shadowsocks + const ShadowsocksR + const Snell + const Socks5 + const Trojan + const Tuic + const URLTest + const Vless + const Vmess + const WireGuard + func (at AdapterType) String() string + type Chain []string + func (c Chain) Last() string + func (c Chain) String() string + type Conn interface + type ConnContext interface + Conn func() *N.BufferedConn + Metadata func() *Metadata + type Connection interface + AppendToChains func(adapter ProxyAdapter) + Chains func() Chain + RemoteDestination func() string + type DNSMode int + const DNSFakeIP + const DNSHosts + const DNSMapping + const DNSNormal + func (e *DNSMode) UnmarshalJSON(data []byte) error + func (e *DNSMode) UnmarshalYAML(unmarshal func(any) error) error + func (e DNSMode) MarshalJSON() ([]byte, error) + func (e DNSMode) MarshalYAML() (any, error) + func (e DNSMode) String() string + type DNSPrefer int + const DualStack + const IPv4Only + const IPv4Prefer + const IPv6Only + const IPv6Prefer + func NewDNSPrefer(prefer string) DNSPrefer + func (d DNSPrefer) String() string + type DelayHistory struct + Delay uint16 + Time time.Time + type DelayHistoryStoreType int + const DropHistory + const ExtraHistory + const OriginalHistory + type Dialer interface + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + ListenPacket func(ctx context.Context, network, address string, rAddrPort netip.AddrPort) (net.PacketConn, error) + type EBpf interface + Close func() + Lookup func(srcAddrPort netip.AddrPort) (socks5.Addr, error) + Start func() error + type Group interface + GetProxies func(touch bool) []Proxy + Touch func() + URLTest func(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (mp map[string]uint16, err error) + type HTTPVersion string + const HTTPVersion11 + const HTTPVersion2 + const HTTPVersion3 + type InboundConfig interface + Equal func(config InboundConfig) bool + Name func() string + type InboundListener interface + Address func() string + Close func() error + Config func() InboundConfig + Listen func(tunnel Tunnel) error + Name func() string + RawAddress func() string + type Listener interface + Address func() string + Close func() error + RawAddress func() string + type Metadata struct + DNSMode DNSMode + DstIP netip.Addr + DstPort uint16 + Host string + InIP netip.Addr + InName string + InPort uint16 + InUser string + NetWork NetWork + Process string + ProcessPath string + RemoteDst string + SniffHost string + SpecialProxy string + SpecialRules string + SrcIP netip.Addr + SrcPort uint16 + Type Type + Uid uint32 + func (m *Metadata) AddrPort() netip.AddrPort + func (m *Metadata) AddrType() int + func (m *Metadata) Pure() *Metadata + func (m *Metadata) RemoteAddress() string + func (m *Metadata) Resolved() bool + func (m *Metadata) RuleHost() string + func (m *Metadata) SetRemoteAddr(addr net.Addr) error + func (m *Metadata) SetRemoteAddress(rawAddress string) error + func (m *Metadata) SourceAddress() string + func (m *Metadata) SourceDetail() string + func (m *Metadata) SourceValid() bool + func (m *Metadata) String() string + func (m *Metadata) UDPAddr() *net.UDPAddr + func (m *Metadata) Valid() bool + type MultiAddrListener interface + AddrList func() (addrList []net.Addr) + Close func() error + Config func() string + type NatTable interface + AddForLocalConn func(lAddr, rAddr string, conn *net.UDPConn) bool + Delete func(key string) + DeleteForLocalConn func(lAddr, key string) + DeleteLock func(key string) + DeleteLockForLocalConn func(lAddr, key string) + Get func(key string) (PacketConn, WriteBackProxy) + GetForLocalConn func(lAddr, rAddr string) *net.UDPConn + GetOrCreateLock func(key string) (*sync.Cond, bool) + GetOrCreateLockForLocalConn func(lAddr string, key string) (*sync.Cond, bool) + RangeForLocalConn func(lAddr string, f func(key string, value *net.UDPConn) bool) + Set func(key string, e PacketConn, w WriteBackProxy) + type NetWork int + const ALLNet + const InvalidNet + const TCP + const UDP + func (n NetWork) MarshalJSON() ([]byte, error) + func (n NetWork) String() string + type PacketAdapter interface + Metadata func() *Metadata + func NewPacketAdapter(packet UDPPacket, metadata *Metadata) PacketAdapter + type PacketConn interface + type PacketConnContext interface + Metadata func() *Metadata + PacketConn func() net.PacketConn + type PlainContext interface + ID func() uuid.UUID + type Proxy interface + Alive func() bool + AliveForTestUrl func(url string) bool + DelayHistory func() []DelayHistory + Dial func(metadata *Metadata) (Conn, error) + DialUDP func(metadata *Metadata) (PacketConn, error) + ExtraDelayHistory func() map[string][]DelayHistory + LastDelay func() uint16 + LastDelayForTestUrl func(url string) uint16 + URLTest func(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16], ...) (uint16, error) + type ProxyAdapter interface + Addr func() string + DialContext func(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (Conn, error) + DialContextWithDialer func(ctx context.Context, dialer Dialer, metadata *Metadata) (Conn, error) + IsL3Protocol func(metadata *Metadata) bool + ListenPacketContext func(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (PacketConn, error) + ListenPacketWithDialer func(ctx context.Context, dialer Dialer, metadata *Metadata) (PacketConn, error) + MarshalJSON func() ([]byte, error) + Name func() string + StreamConnContext func(ctx context.Context, c net.Conn, metadata *Metadata) (net.Conn, error) + SupportTFO func() bool + SupportUDP func() bool + SupportUOT func() bool + SupportWithDialer func() NetWork + SupportXUDP func() bool + Type func() AdapterType + Unwrap func(metadata *Metadata, touch bool) Proxy + type Rule interface + Adapter func() string + Match func(metadata *Metadata) (bool, string) + Payload func() string + RuleType func() RuleType + ShouldFindProcess func() bool + ShouldResolveIP func() bool + type RuleGeoIP interface + GetIPMatcher func() *router.GeoIPMatcher + type RuleGeoSite interface + GetDomainMatcher func() *router.DomainMatcher + type RuleGroup interface + GetRecodeSize func() int + type RuleType int + const AND + const Domain + const DomainKeyword + const DomainSuffix + const DstPort + const GEOIP + const GEOSITE + const IPCIDR + const IPSuffix + const InName + const InPort + const InType + const InUser + const MATCH + const NOT + const Network + const OR + const Process + const ProcessPath + const RuleSet + const SrcIPCIDR + const SrcIPSuffix + const SrcPort + const SubRules + const Uid + func (rt RuleType) String() string + type TUNStack int + const TunGvisor + const TunLWIP + const TunMixed + const TunSystem + func (e *TUNStack) UnmarshalJSON(data []byte) error + func (e *TUNStack) UnmarshalYAML(unmarshal func(any) error) error + func (e TUNStack) MarshalJSON() ([]byte, error) + func (e TUNStack) MarshalYAML() (any, error) + func (e TUNStack) String() string + type Tunnel interface + HandleTCPConn func(conn net.Conn, metadata *Metadata) + HandleUDPPacket func(packet UDPPacket, metadata *Metadata) + NatTable func() NatTable + type Type int + const HTTP + const HTTPS + const HYSTERIA2 + const INNER + const REDIR + const SHADOWSOCKS + const SOCKS4 + const SOCKS5 + const TPROXY + const TUIC + const TUN + const TUNNEL + const VMESS + func ParseType(t string) (*Type, error) + func (t Type) MarshalJSON() ([]byte, error) + func (t Type) String() string + type UDPPacket interface + Data func() []byte + Drop func() + LocalAddr func() net.Addr + type UDPPacketInAddr interface + InAddr func() net.Addr + type WriteBack interface + WriteBack func(b []byte, addr net.Addr) (n int, err error) + type WriteBackProxy interface + UpdateWriteBack func(wb WriteBack)