obfs

package
v0.0.0-...-c071561 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OBFS_NEED_MORE = -1
	OBFS_ERROR     = -2
	OBFS_OK        = 0
)
View Source
const Name = "OBFS"

Variables

View Source
var (
	Debug = true

	// DefaultUserAgent is the default HTTP User-Agent header used by HTTP and websocket.
	DefaultUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
)

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(address *tunnel.Address, tunnel tunnel.Tunnel) (tunnel.Conn, error)

func (*Client) DialPacket

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

type Conn

type Conn struct {
	tunnel.Conn
}

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Metadata

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

func (*Conn) Read

func (c *Conn) Read(p []byte) (n int, err error)

func (*Conn) Write

func (c *Conn) Write(p []byte) (n int, err error)

type ConnectConn

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

func (*ConnectConn) Metadata

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

type Server

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

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 (t *Tunnel) Name() string

func (*Tunnel) NewClient

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

func (*Tunnel) NewServer

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

Jump to

Keyboard shortcuts

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