tcpproxy

package
v0.0.0-...-d38aeb8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocalPortUsed       = errors.New("local port used")
	ErrPortMappingNotFound = errors.New("port mapping not found")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(server string) (*Client, error)

func (*Client) AddPortMapping

func (c *Client) AddPortMapping(localPort int, remoteAddr string) error

func (*Client) DeletePortMapping

func (c *Client) DeletePortMapping(localPort int) error

func (*Client) ListPortMapping

func (c *Client) ListPortMapping() ([]*PortMappingInfo, error)

type Httpd

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

func NewHttpd

func NewHttpd(p *Proxy, s *Store) *Httpd

func (*Httpd) Serv

func (d *Httpd) Serv(l net.Listener) error

type PortMappingInfo

type PortMappingInfo struct {
	LocalPort  int    `json:"localPort"`
	RemoteAddr string `json:"remoteAddr"`
}

type Proxy

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

func NewProxy

func NewProxy() *Proxy

func (*Proxy) AddPortMapping

func (p *Proxy) AddPortMapping(localPort int, remoteAddr *net.TCPAddr) error

func (*Proxy) DeletePortMapping

func (p *Proxy) DeletePortMapping(localPort int) error

func (*Proxy) ListPortMapping

func (p *Proxy) ListPortMapping() []*PortMappingInfo

type Store

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

func NewStore

func NewStore(path string) (*Store, error)

func (*Store) AddPortMapping

func (s *Store) AddPortMapping(pm *PortMappingInfo) error

func (*Store) CleanAndUpdate

func (s *Store) CleanAndUpdate(pms []*PortMappingInfo) error

func (*Store) DeletePortMapping

func (s *Store) DeletePortMapping(localPort int) error

func (*Store) GetAllPortMapping

func (s *Store) GetAllPortMapping() ([]*PortMappingInfo, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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