Documentation
¶
Index ¶
- func CheckVersionX() string
- func InitV2Env(envPath string, key string)
- func MeasureOutboundDelay(ConfigureFileContent string, url string) (int64, error)
- type DNSResult
- type FetchResult
- type ProtectedDialer
- func (d *ProtectedDialer) DestIpAddress() net.IP
- func (d *ProtectedDialer) Dial(ctx context.Context, src v2net.Address, dest v2net.Destination, ...) (net.Conn, error)
- func (d *ProtectedDialer) Init(_ dns.Client, _ outbound.Manager)
- func (d *ProtectedDialer) IsVServerReady() bool
- func (d *ProtectedDialer) PrepareDomain(domainName string, closeCh <-chan struct{}, prefIPv6 bool)
- func (d *ProtectedDialer) PrepareResolveChan()
- func (d *ProtectedDialer) ResolveChan() chan struct{}
- type V2RayPoint
- type V2RayVPNServiceSupportsSet
- type WebResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersionX ¶
func CheckVersionX() string
CheckVersionX string This func will return libv2ray binding version and V2Ray version used.
Types ¶
type DNSResult ¶
type DNSResult struct {
Answers string // JSON array of {name,type,ttl,value}
IPs string // comma-separated A/AAAA answers, convenience field
Rcode string // "NOERROR", "NXDOMAIN", ...
TTL int // TTL of the first answer
Proto string
EchAccepted bool
RespError string
}
DNSResult is the result of ResolveDoH.
func ResolveDoH ¶
ResolveDoH sends a DNS query over DoH, with the same optional fragmentation, ECH and fingerprinting as FetchWeb.
type FetchResult ¶
type FetchResult struct {
RespBody string // response body, gzip-decoded
RespHeader string // X-From-Server, for parity with GetDataFromWeb
RespHeaders string // all response headers, as a JSON object
RespError string // empty on success
StatusCode int
Proto string // "HTTP/1.1", "HTTP/2.0"
EchAccepted bool // true only if the server actually accepted ECH
}
FetchResult is the result of FetchWeb.
func FetchWeb ¶
func FetchWeb(optionsJSON string) *FetchResult
FetchWeb performs an HTTP(S) request with optional TLS fragmentation, ECH and uTLS fingerprinting.
type ProtectedDialer ¶
type ProtectedDialer struct {
// contains filtered or unexported fields
}
ProtectedDialer ...
func NewPreotectedDialer ¶
func NewPreotectedDialer(p protectSet) *ProtectedDialer
NewPreotectedDialer ...
func (*ProtectedDialer) DestIpAddress ¶
func (d *ProtectedDialer) DestIpAddress() net.IP
func (*ProtectedDialer) Dial ¶
func (d *ProtectedDialer) Dial(ctx context.Context, src v2net.Address, dest v2net.Destination, sockopt *v2internet.SocketConfig) (net.Conn, error)
Dial exported as the protected dial method
func (*ProtectedDialer) Init ¶
func (d *ProtectedDialer) Init(_ dns.Client, _ outbound.Manager)
Init implement internet.SystemDialer
func (*ProtectedDialer) IsVServerReady ¶
func (d *ProtectedDialer) IsVServerReady() bool
func (*ProtectedDialer) PrepareDomain ¶
func (d *ProtectedDialer) PrepareDomain(domainName string, closeCh <-chan struct{}, prefIPv6 bool)
PrepareDomain caches direct v2ray server host
func (*ProtectedDialer) PrepareResolveChan ¶
func (d *ProtectedDialer) PrepareResolveChan()
func (*ProtectedDialer) ResolveChan ¶
func (d *ProtectedDialer) ResolveChan() chan struct{}
type V2RayPoint ¶
type V2RayPoint struct {
SupportSet V2RayVPNServiceSupportsSet
Vpoint *v2core.Instance
IsRunning bool
DomainName string
ConfigureFileContent string
AsyncResolve bool
// contains filtered or unexported fields
}
V2RayPoint V2Ray Point Server This is territory of Go, so no getter and setters!
func NewV2RayPoint ¶
func NewV2RayPoint(s V2RayVPNServiceSupportsSet, adns bool) *V2RayPoint
NewV2RayPoint new V2RayPoint
func (*V2RayPoint) MeasureDelay ¶
func (v *V2RayPoint) MeasureDelay(url string) (int64, error)
func (V2RayPoint) QueryStats ¶
func (v V2RayPoint) QueryStats(tag string, direct string) int64
Delegate Funcation
func (*V2RayPoint) RunLoop ¶
func (v *V2RayPoint) RunLoop(prefIPv6 bool) (err error)
RunLoop Run V2Ray main loop
func (*V2RayPoint) StopLoop ¶
func (v *V2RayPoint) StopLoop() (err error)
StopLoop Stop V2Ray main loop
func (*V2RayPoint) TerminateByExit ¶
func (v *V2RayPoint) TerminateByExit()