tunnel

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tunnel implements the tunneling logic for copying data between two network connections both sides.

Index

Constants

View Source
const MaxMessageLength = 1280

MaxMessageLength is the maximum length that is safe to use. TODO(ameshkov): Make it configurable.

View Source
const MinMessageLength = 100

MinMessageLength is the minimum message size. If the message is smaller, it will be padded with random bytes.

Variables

This section is empty.

Functions

func Tunnel

func Tunnel(pipeName string, left io.ReadWriter, right io.ReadWriter)

Tunnel passes data between two connections.

Types

type MsgReadWriter

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

MsgReadWriter is a wrapper over io.ReadWriter that encodes messages written to and read from the base writer.

func NewMsgReadWriter

func NewMsgReadWriter(base io.ReadWriter) (rw *MsgReadWriter)

NewMsgReadWriter creates a new instance of *MsgReadWriter.

func (*MsgReadWriter) Read

func (rw *MsgReadWriter) Read(b []byte) (n int, err error)

Read implements the io.ReadWriter interface for *MsgReadWriter.

func (*MsgReadWriter) Write

func (rw *MsgReadWriter) Write(b []byte) (n int, err error)

Write implements the io.ReadWriter interface for *MsgReadWriter.

Jump to

Keyboard shortcuts

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