wlnet

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const PayloadHeader = "wl-payload"

Variables

This section is empty.

Functions

func Splice

func Splice(ctx context.Context, src, dst io.ReadWriteCloser, maxtime time.Duration, bufsize int) (err error)

splice(ctx, src, dst, maxtime, bufsize) splices src and dst together end-to-end by performing a retransmit() in both directions with buffer size bufsize. If maxtime is not zero, connections are limited to this time-to-live. Can be cancelled through ctx.

Types

type Init

type Init struct {
	Command  string          `json:"command"`
	Protocol string          `json:"protocol,omitempty"`
	Remote   *texturl.URL    `json:"remote,omitempty"`
	Token    *sharetoken.T   `json:"token,omitempty"`
	Version  *semver.Version `json:"version,omitempty"`
}

Init is the struct type encoding values passed while initializing the tunneled connection ("init payload").

func InitFromHeaders added in v0.2.2

func InitFromHeaders(h http.Header) (i *Init, err error)

func (*Init) Headers added in v0.2.2

func (i *Init) Headers() map[string]string

func (*Init) WriteTo

func (i *Init) WriteTo(w io.Writer) error

WriteTo serializes the init payload to some io.Writer.

Directories

Path Synopsis
Package h2conn implements a net.Conn reads and writes over which are actually directed towards a h/2 stream.
Package h2conn implements a net.Conn reads and writes over which are actually directed towards a h/2 stream.
Package h2rwc implements a io.ReadWriteCloser composed from an io.Writer and io.ReadCloser (most probably, http.ResponseWriter and server-side http.Request.Body).
Package h2rwc implements a io.ReadWriteCloser composed from an io.Writer and io.ReadCloser (most probably, http.ResponseWriter and server-side http.Request.Body).

Jump to

Keyboard shortcuts

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