es

package module
v0.0.0-...-1118e41 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

README

es

Easy session/stream protocol

This is v2 of emsg (our private Easy Message Protocol)

OLD emsg and otunnel usage, ref to Chinese usage of otunnel

Arch

Message split design

simple message flow in one order

Example

Documentation

Index

Constants

View Source
const (
	LinkMsgTypePingRequest  = 1
	LinkMsgTypePingResponse = 2
	LinkMsgTypeSession      = 10
	LinkMsgTypeTunnel       = 20
)

message type

Variables

View Source
var (
	ErrBufferIsShort  = errors.New("buffer is short")
	ErrMaxLengthLimit = errors.New("max length limit")
)

common error define

Functions

This section is empty.

Types

type BaseConn

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

BaseConn is the basic connection type

func (*BaseConn) Close

func (c *BaseConn) Close() error

Close close a Conn

func (*BaseConn) Recv

func (c *BaseConn) Recv() (message []byte, err error)

Recv read a message from this Conn

func (*BaseConn) Send

func (c *BaseConn) Send(message []byte) error

Send send a message to this Conn

type Conn

type Conn interface {
	Recv() (message []byte, err error)
	Send(message []byte) error
	Close() error
}

Conn is a interface a Conn

func NewBaseConn

func NewBaseConn(conn io.ReadWriteCloser) Conn

NewBaseConn create a base Conn object

func NewSafeConn

func NewSafeConn(conn io.ReadWriteCloser, cipher *ecrypt.Cipher) Conn

NewSafeConn create a safe Conn

type SafeConn

type SafeConn struct {
	BaseConn
	// contains filtered or unexported fields
}

SafeConn ecrypt Conn

func (*SafeConn) Recv

func (c *SafeConn) Recv() (message []byte, err error)

Recv read a message from this Conn

func (*SafeConn) Send

func (c *SafeConn) Send(message []byte) error

Send send a message to this Conn

Directories

Path Synopsis
example
proto
udp
refs: https://en.wikipedia.org/wiki/User_Datagram_Protocol https://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol https://tools.ietf.org/html/rfc4960 https://en.wikipedia.org/wiki/Datagram_Congestion_Control_Protocol
refs: https://en.wikipedia.org/wiki/User_Datagram_Protocol https://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol https://tools.ietf.org/html/rfc4960 https://en.wikipedia.org/wiki/Datagram_Congestion_Control_Protocol

Jump to

Keyboard shortcuts

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