Documentation
¶
Index ¶
Constants ¶
View Source
const ( AtypIPv4 = 1 AtypDomainName = 3 AtypIPv6 = 4 TCP = iota UDP )
Socks addr type
View Source
const ( Name = "clash" DefalutHTTPPort = 7890 DefalutSOCKSPort = 7891 )
Variables ¶
View Source
var ( HomeDir string ConfigPath string MMDBPath string )
Functions ¶
Types ¶
type AdapterType ¶ added in v0.5.0
type AdapterType int
AdapterType is enum of adapter type
const ( Direct AdapterType = iota Reject Selector Shadowsocks URLTest )
Adapter Type
func (AdapterType) String ¶ added in v0.5.0
func (at AdapterType) String() string
type Proxy ¶
type Proxy interface {
Name() string
Type() AdapterType
Generator(addr *Addr) (ProxyAdapter, error)
}
type ProxyAdapter ¶
type ProxyAdapter interface {
ReadWriter() io.ReadWriter
Conn() net.Conn
Close()
}
type ProxySignal ¶ added in v0.5.0
type ProxySignal struct {
Done chan<- struct{}
Closed <-chan struct{}
}
ProxySignal is used to handle graceful shutdown of proxy
type ServerAdapter ¶
type ServerAdapter interface {
Addr() *Addr
Connect(ProxyAdapter)
Close()
}
type Traffic ¶ added in v0.4.0
type Traffic struct {
// contains filtered or unexported fields
}
func NewTraffic ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.