tcptunnel

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tcptunnel contains an implementation of a TCP tunnel via HTTP Connect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

An Option modifies the config.

func WithDestinationHost

func WithDestinationHost(dstHost string) Option

WithDestinationHost returns an option to configure the destination host.

func WithJWTCache

func WithJWTCache(jwtCache cliutil.JWTCache) Option

WithJWTCache returns an option to configure the jwt cache.

func WithProxyHost

func WithProxyHost(proxyHost string) Option

WithProxyHost returns an option to configure the proxy host.

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig returns an option to configure the tls config.

type Tunnel

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

A Tunnel represents a TCP tunnel over HTTP Connect.

func New

func New(options ...Option) *Tunnel

New creates a new Tunnel.

func (*Tunnel) Run

func (tun *Tunnel) Run(ctx context.Context, local io.ReadWriter) error

Run establishes a TCP tunnel via HTTP Connect and forwards all traffic from/to local.

func (*Tunnel) RunListener

func (tun *Tunnel) RunListener(ctx context.Context, listenerAddress string) error

RunListener runs a network listener on the given address. For each incoming connection a new TCP tunnel is established via Run.

Jump to

Keyboard shortcuts

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