conn

package
v0.0.0-...-7757972 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	STREAM_LAYER     = ConnLayer(1)
	OBS_LAYER        = ConnLayer(2)
	CRYPT_LAYER      = ConnLayer(3)
	AUTH_LAYER       = ConnLayer(4)
	APPCATIOIN_LAYER = ConnLayer(5)
)
View Source
const (
	PROTO_TCP   = TransProtocol("tcp")
	PROTO_KCP   = TransProtocol("kcp")
	PROTO_OBFS4 = TransProtocol("obfs4")
)

Variables

View Source
var (
	ErrInvalidArgs = errors.New("Invalid arguments.")
	ErrInvalidCtx  = errors.New("Invalid context")
)

Functions

func CopyLink(dst, src io.ReadWriteCloser)

func CoreCopy

func CoreCopy(dst io.Writer, src io.Reader) (written int64, err error)

func Dial

func Dial(contexts []ConnLayerContext) (c net.Conn, err error)

func NewListener

func NewListener(contexts []ConnLayerContext) (l net.Listener, err error)

Types

type ConnDialer

type ConnDialer interface {
	Dial(net.Conn) (net.Conn, error)
}

type ConnLayer

type ConnLayer int

type ConnLayerContext

type ConnLayerContext interface {
	Layer() ConnLayer
	ConnDialer
	ConnListener
}

type ConnListener

type ConnListener interface {
	NewListener(net.Listener) (net.Listener, error)
}

type TransProtocol

type TransProtocol string

func (*TransProtocol) UnmarshalTOML

func (self *TransProtocol) UnmarshalTOML(data []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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