obfs

package
v0.0.0-...-e5d0cd3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObfs

func NewObfs(name string) *constructor

NewObfs create an Obfs object by name and return as an IObfs interface

Types

type Conn

type Conn struct {
	netproxy.Conn
	Obfs IObfs
	// contains filtered or unexported fields
}

func NewConn

func NewConn(c netproxy.Conn, obfs IObfs) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

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

func (*Conn) SetAddrLen

func (c *Conn) SetAddrLen(addrLen int)

func (*Conn) SetCipher

func (c *Conn) SetCipher(cipher *ciphers.StreamCipher)

func (*Conn) Write

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

type Creator

type Creator func() IObfs

type Dialer

type Dialer struct {
	NextDialer netproxy.Dialer
	// contains filtered or unexported fields
}

func NewDialer

func NewDialer(nextDialer netproxy.Dialer, param *ObfsParam) (*Dialer, error)

func (*Dialer) Dial

func (d *Dialer) Dial(network, addr string) (netproxy.Conn, error)

func (*Dialer) ObfsOverhead

func (d *Dialer) ObfsOverhead() int

type IObfs

type IObfs interface {
	SetServerInfo(s *ServerInfo)
	GetServerInfo() (s *ServerInfo)
	Encode(data []byte) (encodedData []byte, err error)
	Decode(data []byte) (decodedData []byte, needSendBack bool, err error)
	SetData(data interface{})
	GetData() interface{}
}

type ObfsParam

type ObfsParam struct {
	ObfsHost  string
	ObfsPort  uint16
	Obfs      string
	ObfsParam string
}

type ServerInfo

type ServerInfo struct {
	Host  string
	Port  uint16
	Param string

	AddrLen int
	Key     []byte
	IVLen   int
}

Jump to

Keyboard shortcuts

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