service

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn net.Conn) *client

Types

type Conn

type Conn struct {
	net.Conn
	// reading/writing interfaces
	Reader *bufio.Reader
	Writer *bufio.Writer
}

type PlumberSrv

type PlumberSrv struct {
	SrvAddr string

	// tcp listener map[localPort]listener
	TcpListenerMap map[int]net.Listener

	Conf *config.SrvConf
	// contains filtered or unexported fields
}

func NewService

func NewService(conf *config.SrvConf) *PlumberSrv

func (*PlumberSrv) Close

func (s *PlumberSrv) Close()

func (*PlumberSrv) Exit

func (s *PlumberSrv) Exit()

func (*PlumberSrv) HandleClientCommands

func (s *PlumberSrv) HandleClientCommands() error

func (*PlumberSrv) HandleHttpForward

func (s *PlumberSrv) HandleHttpForward() error

func (*PlumberSrv) Run

func (s *PlumberSrv) Run()

func (*PlumberSrv) VerifyIP

func (s *PlumberSrv) VerifyIP(conn net.Conn) bool

Verify whether the IP is in the whitelist

type ServProtocol

type ServProtocol struct {
	Plumber *PlumberSrv
}

func NewServProtocol

func NewServProtocol(srv *PlumberSrv) *ServProtocol

func (*ServProtocol) ExecCommand

func (s *ServProtocol) ExecCommand(c *client, cmdType protocol.CommandType, params [][]byte) ([]byte, error)

func (*ServProtocol) IOLoop

func (s *ServProtocol) IOLoop(c protocol.Client) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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