pcp

package
v0.0.0-...-c8b15d8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Protocol     *pcpProtocol
	MiniProtocol = protocols.NewMiniProtocol(Protocol)
)

Functions

func RegisterServer

func RegisterServer(server *protocols.Server, handler Handler) error

Types

type Client

type Client struct {
	protocols.Client
}

func NewClient

func NewClient(client protocols.Client) (*Client, error)

func NewClientFor

func NewClientFor(server_addr string) (*Client, error)

func (*Client) StartProxy

func (client *Client) StartProxy(listenAddr string, targetAddr string) error

func (*Client) StartProxyPair

func (client *Client) StartProxyPair(proxyHost, receiverHost string, receiverPort1, receiverPort2 int) (*StartProxyPairResponse, error)

func (*Client) StopProxy

func (client *Client) StopProxy(listenAddr string, targetAddr string) error

func (*Client) StopProxyPair

func (client *Client) StopProxyPair(proxyPort1 int) error

type Handler

type Handler interface {
	StartProxy(val *StartProxy) error
	StopProxy(val *StopProxy) error
	StartProxyPair(val *StartProxyPair) (*StartProxyPairResponse, error)
	StopProxyPair(val *StopProxyPair) error
	StopServer()
}

type ProxyDescription

type ProxyDescription struct {
	ListenAddr string
	TargetAddr string
}

func (*ProxyDescription) ListenPort

func (desc *ProxyDescription) ListenPort() (int, error)

type StartProxy

type StartProxy struct {
	ProxyDescription
}

type StartProxyPair

type StartProxyPair struct {
	ProxyHost     string
	ReceiverHost  string
	ReceiverPort1 int
	ReceiverPort2 int
}

type StartProxyPairResponse

type StartProxyPairResponse struct {
	ProxyHost  string
	ProxyPort1 int
	ProxyPort2 int
}

type StopProxy

type StopProxy struct {
	ProxyDescription
}

type StopProxyPair

type StopProxyPair struct {
	ProxyPort1 int
}

Jump to

Keyboard shortcuts

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