caddy_forward

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialRemoteLoop

func DialRemoteLoop(n pointc.Net, dstPort uint16, pairs <-chan *ConnPair, dialed chan<- *ConnPair)

func ListenLoop

func ListenLoop(ln net.Listener, conns chan<- net.Conn)

func PrepareConnPairLoop

func PrepareConnPairLoop(ctx context.Context, logger *slog.Logger, conns <-chan net.Conn, pairs chan<- *ConnPair)

func StartCopyLoop

func StartCopyLoop(pairs <-chan *ConnPair, copyFn func(done func(), dst io.Writer, src io.Reader, logger *slog.Logger))

func TcpCopy

func TcpCopy(done func(), dst io.Writer, src io.Reader, logger *slog.Logger)

Types

type ConnPair

type ConnPair struct {
	Ctx    context.Context
	Cancel context.CancelFunc
	Remote net.Conn
	Tunnel net.Conn
	Logger *slog.Logger
}

func (*ConnPair) DialTunnel

func (cp *ConnPair) DialTunnel(n pointc.Net, dstPort uint16) bool

type Forward

type Forward struct {
	ForwardsRaw []json.RawMessage `json:"forwards,omitempty" caddy:"namespace=point-c.op.forward inline_key=forward"`
	Host        configvalues.Hostname
	// contains filtered or unexported fields
}

func (*Forward) CaddyModule

func (f *Forward) CaddyModule() caddy.ModuleInfo

func (*Forward) Cleanup

func (f *Forward) Cleanup() error

func (*Forward) Provision

func (f *Forward) Provision(ctx caddy.Context) error

func (*Forward) Start

func (f *Forward) Start(lookup pointc.NetLookup) error

func (*Forward) Stop

func (f *Forward) Stop() error

Stop is not needed, [NetOps.Cleanup] already handles closing all ops

func (*Forward) UnmarshalCaddyfile

func (f *Forward) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

type ForwardProto

type ForwardProto = lifecycler.LifeCyclable[pointc.Net]

type ForwardTCP

type ForwardTCP struct {
	Ports configvalues.PortPair `json:"ports"`
	// contains filtered or unexported fields
}

func (*ForwardTCP) CaddyModule

func (f *ForwardTCP) CaddyModule() caddy.ModuleInfo

func (*ForwardTCP) Cleanup

func (f *ForwardTCP) Cleanup() error

func (*ForwardTCP) Provision

func (f *ForwardTCP) Provision(ctx caddy.Context) error

func (*ForwardTCP) Start

func (f *ForwardTCP) Start(n pointc.Net) error

func (*ForwardTCP) Stop

func (f *ForwardTCP) Stop() error

func (*ForwardTCP) UnmarshalCaddyfile

func (f *ForwardTCP) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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