tunnel

package
Version: v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tunnel provides gre network tunnelling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	// Specifies the tunnel id
	Id() string
	// The session
	Session() string
	// a transport socket
	transport.Socket
}

Conn is a connection dialed or accepted which includes the tunnel id and session

type Listener

type Listener interface {
	Addr() string
	Close() error
	Accept() (Conn, error)
}

The listener provides similar constructs to the transport.Listener

type Tunnel

type Tunnel interface {
	// Connect connects the tunnel
	Connect() error
	// Close closes the tunnel
	Close() error
	// Dial an endpoint
	Dial(addr string) (Conn, error)
	// Accept connections
	Listen(addr string) (Listener, error)
}

Tunnel creates a gre network tunnel on top of a link. It establishes multiple streams using the Micro-Tunnel-Id header and Micro-Tunnel-Session header. The tunnel id is a hash of the address being requested.

func NewTunnel

func NewTunnel(l link.Link) Tunnel

NewTunnel creates a new tunnel on top of a link

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL