simplesocks

package
v1.0.6-rc20 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connect   tunnel.Command = 1
	Associate tunnel.Command = 3
)
View Source
const Name = "SIMPLESOCKS"

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, underlay tunnel.Client) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialConn

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

func (*Client) DialPacket

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

type Conn

type Conn struct {
	tunnel.Conn
	// contains filtered or unexported fields
}

Conn is a simplesocks connection

func (*Conn) Metadata

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

func (*Conn) Write

func (c *Conn) Write(payload []byte) (int, error)

type PacketConn

type PacketConn struct {
	trojan.PacketConn
}

PacketConn is a simplesocks packet connection The header syntax is the same as trojan's

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a simplesocks server

func NewServer

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

func (*Server) AcceptConn

func (s *Server) AcceptConn(tunnel.Tunnel) (tunnel.Conn, error)

func (*Server) AcceptPacket

func (s *Server) AcceptPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Server) Close

func (s *Server) Close() error

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

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

func (*Tunnel) NewServer

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

Jump to

Keyboard shortcuts

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