httptunnel

package
v0.10.7-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultConnectionURL = "/connection"
	DefaultRevdialURL    = "/revdial"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Tunnel

type Tunnel struct {
	ConnectionPath    string
	DialerPath        string
	ConnectionHandler func(*http.Request) (string, error)
	CloseHandler      func(string)
	KeepAliveHandler  func(string)
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(connectionPath, dialerPath string) *Tunnel

func (*Tunnel) Dial

func (t *Tunnel) Dial(ctx context.Context, id string) (net.Conn, error)

func (*Tunnel) ForwardResponse

func (t *Tunnel) ForwardResponse(resp *http.Response, w http.ResponseWriter)

func (*Tunnel) Router

func (t *Tunnel) Router() http.Handler

func (*Tunnel) SendRequest

func (t *Tunnel) SendRequest(ctx context.Context, id string, req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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