freedom

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: GPL-3.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const MaxPacketSize = 1024 * 8
View Source
const Name = "FREEDOM"

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(ctx context.Context, _ tunnel.Client) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialConn

func (c *Client) DialConn(addr *tunnel.Address, _ tunnel.Tunnel) (tunnel.Conn, error)

func (*Client) DialPacket

func (c *Client) DialPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

type Config

type Config struct {
	LocalHost    string             `json:"local_addr" yaml:"local-addr"`
	LocalPort    int                `json:"local_port" yaml:"local-port"`
	TCP          TCPConfig          `json:"tcp" yaml:"tcp"`
	ForwardProxy ForwardProxyConfig `json:"forward_proxy" yaml:"forward-proxy"`
}

type Conn

type Conn struct {
	net.Conn
}

func (*Conn) Metadata

func (c *Conn) Metadata() *tunnel.Metadata

type ForwardProxyConfig

type ForwardProxyConfig struct {
	Enabled   bool   `json:"enabled" yaml:"enabled"`
	ProxyHost string `json:"proxy_addr" yaml:"proxy-addr"`
	ProxyPort int    `json:"proxy_port" yaml:"proxy-port"`
	Username  string `json:"username" yaml:"username"`
	Password  string `json:"password" yaml:"password"`
}

type PacketConn

type PacketConn struct {
	*net.UDPConn
}

func (*PacketConn) ReadWithMetadata

func (c *PacketConn) ReadWithMetadata(p []byte) (int, *tunnel.Metadata, error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (int, error)

func (*PacketConn) WriteWithMetadata

func (c *PacketConn) WriteWithMetadata(p []byte, m *tunnel.Metadata) (int, error)

type SocksPacketConn added in v0.7.8

type SocksPacketConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

func (*SocksPacketConn) Close added in v0.7.8

func (c *SocksPacketConn) Close() error

func (*SocksPacketConn) ReadWithMetadata added in v0.7.8

func (c *SocksPacketConn) ReadWithMetadata(payload []byte) (int, *tunnel.Metadata, error)

func (*SocksPacketConn) WriteWithMetadata added in v0.7.8

func (c *SocksPacketConn) WriteWithMetadata(payload []byte, metadata *tunnel.Metadata) (int, error)

type TCPConfig

type TCPConfig struct {
	PreferIPV4 bool `json:"prefer_ipv4" yaml:"prefer-ipv4"`
	KeepAlive  bool `json:"keep_alive" yaml:"keep-alive"`
	NoDelay    bool `json:"no_delay" yaml:"no-delay"`
}

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

func (*Tunnel) NewClient(ctx context.Context, client tunnel.Client) (tunnel.Client, error)

func (*Tunnel) NewServer

func (*Tunnel) NewServer(ctx context.Context, client tunnel.Server) (tunnel.Server, error)

Jump to

Keyboard shortcuts

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