Documentation
¶
Overview ¶
Package mobile is the gomobile-compatible IPv4 tunnel client. Operating-system VPN services own routes and DNS; this package owns transport.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is single-use. Create a new instance after Close or a terminal error. All exported methods are safe to call from different native threads.
func (*Client) Connect ¶
Connect authenticates before the OS installs VPN routes. The result is JSON containing the negotiated addresses, endpoint_ipv4 and MTU.
func (*Client) ReadPacket ¶
ReadPacket blocks until one raw IPv4 packet arrives or Close is called. Use a background thread, never the UI thread.
func (*Client) WritePacket ¶
WritePacket copies one raw IPv4 packet from the OS. Under congestion packets are dropped instead of blocking the native VPN callback.
type SocketProtector ¶
SocketProtector must protect the fd synchronously before returning. Android passes VpnService.protect; iOS passes nil (provider sockets bypass VPN).