tunnel

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataStore = tunnelDataStore{}

Used to store all active tunnels information

Functions

func NewTunnel

func NewTunnel(stream *quic.Stream, endpoint string) tunnel

Types

type HandshakeHelper

type HandshakeHelper struct {
	// The function used to process handshake, the handshake processes
	// are different between server endpoint and client endpoint.
	Handshakefunc handshakefunc `json:"-"`
	TokenSource   *token.TokenSourcePlugin
	TokenParser   *token.TokenParserPlugin
	// The data will send to remote endpoint. In client
	// endpoit, this means 'token'; In server endpoint,
	// this means ack message.
	SendData []byte
	// Used to store the data receive from remote endpoint. In
	// server endpoint, this store the 'token'; In client endpoint,
	// this store the ack message.
	ReceiveData string
}

func NewHandshakeHelper

func NewHandshakeHelper(length int, hsf handshakefunc) HandshakeHelper

func (*HandshakeHelper) Read

func (h *HandshakeHelper) Read(p []byte) (n int, err error)

func (*HandshakeHelper) SetSendData

func (h *HandshakeHelper) SetSendData(data []byte)

Set the data which will be send to remote endpoint. For client endpoint, this means set a token; for server endpoint, this means set a ack message.

func (*HandshakeHelper) Write

func (h *HandshakeHelper) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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