es

package module
v0.0.0-...-6ccd4f6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: GPL-3.0 Imports: 5 Imported by: 13

README

es

GoDoc Go Report Card Build Status

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

CI

GitHub Actions workflow: .github/workflows/ci.yml. It validates module metadata and runs go build ./... plus go test ./... on push/PR.

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
tcp/client command
tcp/server command
udp/client command
udp/server command
proto
udp
refs:
refs:

Jump to

Keyboard shortcuts

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