Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputPacket ¶
func InputPacket(data []byte)
Write IP packets to the lwIP stack. Call this function in the main loop of the VpnService in Java/Kotlin, which should reads packets from the TUN fd.
func SetLocalDNS ¶ added in v0.3.0
func SetLocalDNS(dns string)
SetLocalDNS sets the DNS server that used by Go's default resolver, it accepts string in the form "host:port", e.g. 223.5.5.5:53
func SetNonblock ¶
SetNonblock puts the fd in blocking or non-blocking mode.
func StartV2Ray ¶
func StartV2Ray(packetFlow PacketFlow, vpnService VpnService, dbService DBService, configBytes []byte, assetPath, proxyLogDBPath string)
StartV2Ray sets up lwIP stack, starts a V2Ray instance and registers the instance as the connection handler for tun2socks.
Types ¶
type PacketFlow ¶
type PacketFlow interface { // WritePacket should writes packets to the TUN fd. WritePacket(packet []byte) }
PacketFlow should be implemented in Java/Kotlin.
type VpnService ¶
type VpnService interface { // Protect is just a proxy to the VpnService.protect() method. // See also: https://developer.android.com/reference/android/net/VpnService.html#protect(int) Protect(fd int) bool }
VpnService should be implemented in Java/Kotlin.
Click to show internal directories.
Click to hide internal directories.