permuteproxy

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 6 Imported by: 1

README

Permute Proxy

Permute Proxy is a permuting proxy engine that combines multiple protocols into a single proxy protocol.

Go Report Card GoDoc GitHub license gocover.io

This project is to add protocol support for the Bridge, or it can be used alone

The following is the implementation of other proxy protocols

License

Licensed under the MIT License. See LICENSE for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProxy = fmt.Errorf("no proxy")

Functions

func Register added in v0.0.2

func Register(scheme string, f Define)

func RegisterHandle

func RegisterHandle(scheme string, h Handler)

Types

type Addr

type Addr = net.Addr

type CommandDialFunc added in v0.0.2

type CommandDialFunc func(ctx context.Context, name string, args ...string) (net.Conn, error)

CommandDialFunc type is an adapter for Dialer with command.

func (CommandDialFunc) CommandDialContext added in v0.0.2

func (d CommandDialFunc) CommandDialContext(ctx context.Context, name string, args ...string) (net.Conn, error)

CommandDialContext calls d(ctx, name, args...)

type CommandDialer added in v0.0.2

type CommandDialer interface {
	CommandDialContext(ctx context.Context, name string, args ...string) (net.Conn, error)
}

CommandDialer contains options for connecting to an address with command.

type CommandDialerWrapper added in v0.0.2

type CommandDialerWrapper interface {
	CommandDialerWrap(ctx context.Context, metadata Metadata) (CommandDialer, error)
}

CommandDialerWrapper wraps a CommandDialer with additional options.

type CommandDialerWrapperFunc added in v0.0.2

type CommandDialerWrapperFunc func(ctx context.Context, metadata Metadata) (CommandDialer, error)

CommandDialerWrapperFunc type is an adapter for CommandDialerWrapper.

func (CommandDialerWrapperFunc) CommandDialerWrap added in v0.0.2

func (d CommandDialerWrapperFunc) CommandDialerWrap(ctx context.Context, metadata Metadata) (CommandDialer, error)

CommandDialerWrap calls d(commandDialer)

type Conn

type Conn = net.Conn

type Define

type Define struct {
	Handler
	protocols.SchemeInfo
}

type DialConn

type DialConn interface {
	Dial(ctx context.Context) (Conn, error)
}

DialConn wraps a net.Conn with additional options.

type DialConnFunc

type DialConnFunc func(ctx context.Context) (Conn, error)

DialConnFunc type is an adapter for DialConn.

func (DialConnFunc) Dial

func (d DialConnFunc) Dial(ctx context.Context) (Conn, error)

Dial calls d()

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (Conn, error)
}

Dialer contains options for connecting to an address.

type DialerFunc

type DialerFunc func(ctx context.Context, network, address string) (Conn, error)

DialerFunc type is an adapter for Dialer.

func (DialerFunc) DialContext

func (d DialerFunc) DialContext(ctx context.Context, network, address string) (Conn, error)

DialContext calls d(ctx, network, address)

type DialerWrapper

type DialerWrapper interface {
	DialerWrap(ctx context.Context, metadata Metadata) (Dialer, error)
}

DialerWrapper wraps a Dialer with additional options.

type DialerWrapperFunc

type DialerWrapperFunc func(ctx context.Context, metadata Metadata) (Dialer, error)

DialerWrapperFunc type is an adapter for DialerWrapper.

func (DialerWrapperFunc) DialerWrap

func (d DialerWrapperFunc) DialerWrap(ctx context.Context, metadata Metadata) (Dialer, error)

DialerWrap calls d(dialer)

type Handler

type Handler struct {
	Dialer                    Dialer
	DialerWrapper             DialerWrapper
	ListenConfig              ListenConfig
	ListenConfigWrapper       ListenConfigWrapper
	ListenPacketConfig        ListenPacketConfig
	ListenPacketConfigWrapper ListenPacketConfigWrapper
	CommandDialer             CommandDialer
	CommandDialerWrapper      CommandDialerWrapper
	NewRunner                 NewRunner
}

type ListenConfig

type ListenConfig interface {
	Listen(ctx context.Context, network, address string) (Listener, error)
}

ListenConfig contains options for listening to an address.

type ListenConfigFunc

type ListenConfigFunc func(ctx context.Context, network, address string) (Listener, error)

ListenConfigFunc type is an adapter for ListenConfig.

func (ListenConfigFunc) Listen

func (l ListenConfigFunc) Listen(ctx context.Context, network, address string) (Listener, error)

Listen calls b(ctx, network, address)

type ListenConfigWrapper

type ListenConfigWrapper interface {
	ListenConfigWrap(ctx context.Context, metadata Metadata) (ListenConfig, error)
}

ListenConfigWrapper wraps a ListenConfig with additional options.

type ListenConfigWrapperFunc

type ListenConfigWrapperFunc func(ctx context.Context, metadata Metadata) (ListenConfig, error)

ListenConfigWrapperFunc type is an adapter for ListenConfigWrapper.

func (ListenConfigWrapperFunc) ListenConfigWrap

func (l ListenConfigWrapperFunc) ListenConfigWrap(ctx context.Context, metadata Metadata) (ListenConfig, error)

ListenConfigWrap calls l(listenConfig)

type ListenConn

type ListenConn interface {
	Listen(ctx context.Context) (Listener, error)
}

ListenConn wraps a net.Conn with additional options.

type ListenConnFunc

type ListenConnFunc func(ctx context.Context) (Listener, error)

ListenConnFunc type is an adapter for ListenConn.

func (ListenConnFunc) Listen

func (d ListenConnFunc) Listen(ctx context.Context) (Listener, error)

Listen calls d()

type ListenPacketConfig added in v0.0.2

type ListenPacketConfig interface {
	ListenPacket(ctx context.Context, network, address string) (PacketConn, error)
}

ListenPacketConfig contains options for listening to an address.

type ListenPacketConfigFunc added in v0.0.2

type ListenPacketConfigFunc func(ctx context.Context, network, address string) (PacketConn, error)

ListenPacketConfigFunc type is an adapter for ListenPacketConfig.

func (ListenPacketConfigFunc) ListenPacket added in v0.0.2

func (l ListenPacketConfigFunc) ListenPacket(ctx context.Context, network, address string) (PacketConn, error)

ListenPacket calls b(ctx, network, address)

type ListenPacketConfigWrapper added in v0.0.2

type ListenPacketConfigWrapper interface {
	ListenPacketConfigWrap(ctx context.Context, metadata Metadata) (ListenPacketConfig, error)
}

ListenPacketConfigWrapper wraps a ListenPacketConfig with additional options.

type ListenPacketConfigWrapperFunc added in v0.0.2

type ListenPacketConfigWrapperFunc func(lctx context.Context, metadata Metadata) (ListenPacketConfig, error)

ListenPacketConfigWrapperFunc type is an adapter for ListenPacketConfigWrapper.

func (ListenPacketConfigWrapperFunc) ListenPacketConfigWrap added in v0.0.2

func (l ListenPacketConfigWrapperFunc) ListenPacketConfigWrap(ctx context.Context, metadata Metadata) (ListenPacketConfig, error)

ListenPacketConfigWrap calls l(listenPacketConfig)

type Listener

type Listener = net.Listener

type Metadata

type Metadata = url.Values

type NewRunner

type NewRunner interface {
	New(listener Listener, metadata Metadata) (Runner, error)
}

NewRunner creates a new Runner.

type NewRunnerFunc

type NewRunnerFunc func(listener Listener, metadata Metadata) (Runner, error)

NewRunnerFunc type is an adapter for NewRunner.

func (NewRunnerFunc) New

func (n NewRunnerFunc) New(listener Listener, metadata Metadata) (Runner, error)

New calls n(listener, metadata)

type PacketConn added in v0.0.2

type PacketConn = net.PacketConn

type Proxy added in v0.0.2

type Proxy struct {
	Dialer             Dialer
	ListenConfig       ListenConfig
	ListenPacketConfig ListenPacketConfig
	CommandDialer      CommandDialer
}

func FromContext added in v0.0.2

func FromContext(ctx context.Context) (*Proxy, bool)

func (*Proxy) NewDialConn added in v0.0.2

func (p *Proxy) NewDialConn(uri string) (DialConn, error)

NewDialConn returns a DialConn for the given uri. If the last kind is stream-like. will return DialConn

func (*Proxy) NewDialer added in v0.0.2

func (p *Proxy) NewDialer(uri string) (Dialer, error)

NewDialer returns a Dialer from the uri If the last kind is proxy, it will return Dialer

func (*Proxy) NewListenConn added in v0.0.2

func (p *Proxy) NewListenConn(uri string) (ListenConn, error)

NewListenConn returns a new ListenConn. If the last kind is stream-like. will return ListenConn

func (*Proxy) NewRunner added in v0.0.2

func (p *Proxy) NewRunner(uri string) (Runner, error)

NewRunner returns a new Runner. If the last kind is proxy, it will return Runner

type Runner

type Runner interface {
	Run(ctx context.Context) error
	Close() error
}

Runner is a runner.

Directories

Path Synopsis
internal
tls

Jump to

Keyboard shortcuts

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