tcpmux

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: 12 Imported by: 3

README

tunnel

A simple tcp tunnel.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdNotFound = errors.New("id not found")
)

Functions

func Pipeline

func Pipeline(r, w *net.TCPConn, wg *sync.WaitGroup) error

func ReadHeader

func ReadHeader(c io.Reader) (string, error)

func WriteHeader

func WriteHeader(code string, c io.Writer) error

Types

type Client

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

func NewClient

func NewClient(server string, logger *log.Logger,
	proxy string, debug bool) (*Client, error)

func (*Client) AddTarget

func (c *Client) AddTarget(id string, target string) error

func (*Client) DeleteTarget

func (c *Client) DeleteTarget(id string) error

func (*Client) ListTarget

func (c *Client) ListTarget() ([]*TargetInfo, error)

type Httpd

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

func NewHttpd

func NewHttpd(m *Tcpmux, s *Store, logger *log.Logger) *Httpd

func (*Httpd) Serv

func (d *Httpd) Serv(port int) error

type Store

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

func NewStore

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

func (*Store) AddTarget

func (s *Store) AddTarget(pm *TargetInfo) error

func (*Store) CleanAndUpdate

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

func (*Store) DeleteTarget

func (s *Store) DeleteTarget(id string) error

func (*Store) GetAllTarget

func (s *Store) GetAllTarget() ([]*TargetInfo, error)

type TargetInfo

type TargetInfo struct {
	Id     string `json:"id"`
	Target string `json:"target"`
}

type Tcpmux

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

func NewTcpMux

func NewTcpMux(logger *log.Logger) *Tcpmux

func (*Tcpmux) AddTarget

func (m *Tcpmux) AddTarget(id, target string) error

func (*Tcpmux) DeleteTarget

func (m *Tcpmux) DeleteTarget(id string) error

func (*Tcpmux) ListTarget

func (m *Tcpmux) ListTarget() []TargetInfo

func (*Tcpmux) Start

func (m *Tcpmux) Start(port int) error

func (*Tcpmux) Stop

func (m *Tcpmux) Stop()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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