proxy

package
v0.0.0-...-b199937 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPacketSize = 1024 * 8
)
View Source
const Name = "PROXY"

Variables

This section is empty.

Functions

func CreateClientStack

func CreateClientStack(ctx context.Context, clientStack []string) (tunnel.Client, error)

CreateClientStack create client tunnel stacks from lists

func CreateServerStack

func CreateServerStack(ctx context.Context, serverStack []string) (tunnel.Server, error)

CreateServerStack create server tunnel stack from list

func FindAllEndpoints

func FindAllEndpoints(root *Node) []tunnel.Server

func RegisterProxyCreator

func RegisterProxyCreator(name string, creator Creator)

Types

type Config

type Config struct {
	RunType         string `json:"run_type" yaml:"run-type"`
	LogLevel        int    `json:"log_level" yaml:"log-level"`
	LogFile         string `json:"log_file" yaml:"log-file"`
	RelayBufferSize int    `json:"relay_buffer_size" yaml:"relay_buffer_size"`
}

type Creator

type Creator func(ctx context.Context) (*Proxy, error)

type Node

type Node struct {
	Name       string
	Next       map[string]*Node
	IsEndpoint bool
	context.Context
	tunnel.Server
	tunnel.Client
}

func (*Node) BuildNext

func (n *Node) BuildNext(name string) *Node

func (*Node) LinkNextNode

func (n *Node) LinkNextNode(next *Node) *Node

type Option

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

func (*Option) Handle

func (o *Option) Handle() error

func (*Option) Name

func (o *Option) Name() string

func (*Option) Priority

func (o *Option) Priority() int

type Proxy

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

Proxy relay connections and packets

func NewProxy

func NewProxy(ctx context.Context, cancel context.CancelFunc, sources []tunnel.Server, sink tunnel.Client) *Proxy

func NewProxyFromConfigData

func NewProxyFromConfigData(data []byte, isJSON bool) (*Proxy, error)

func (*Proxy) Close

func (p *Proxy) Close() error

func (*Proxy) Run

func (p *Proxy) Run() error

type StdinOption

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

func (*StdinOption) Handle

func (o *StdinOption) Handle() error

func (*StdinOption) Name

func (o *StdinOption) Name() string

func (*StdinOption) Priority

func (o *StdinOption) Priority() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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