obfs

package
v0.0.0-...-b617006 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 17 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) DialContext

func (d *Dialer) DialContext(ctx context.Context, 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