client

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package client implements the shadowgate client. It opens one or more links to the server — a TCP link and a UDP link — probes each with keepalives, and sends tunnel traffic over the healthy link with the lowest latency, switching automatically as conditions change (or falling back when one path fails).

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
}

func NewClient

func NewClient(device tun.TUN, ip net.IP, network *net.IPNet, connect string, password []byte, useCompression bool, maxPadding int, timeout time.Duration) (*Client, error)

NewClient tunnels over an already-opened tun device. It runs a UDP link and a TCP link to the server, each of which keeps itself connected (re-dialing on failure), and adapts between them at runtime. It fails only if the server address is malformed.

func (*Client) Close

func (self *Client) Close() error

func (*Client) Interface

func (self *Client) Interface() string

func (*Client) Run

func (self *Client) Run(signaling chan os.Signal) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL