proxy

package
v0.0.0-...-e19ae27 Latest Latest
Warning

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

Go to latest
Published: May 2, 2017 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Overview

Package proxy provides proxy service and redirects requests form proxy.Addr to remote.Addr.

Package proxy provides proxy service and redirects requests form proxy.Addr to remote.Addr.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResultFormater

func ResultFormater(res sql.Result)

Parse exec's results and formate it,then will be print in command line such as: OK, [n] rows affected else error

func RowsFormater

func RowsFormater(rows *sql.Rows)

Parse query's results and formate it,then will be print in command line such as: +---------+----------------+----------+ | ID | IP | NAME | +---------+----------------+----------+ | 1 | 180.17.95.2 | Jack | | 2 | 180.17.95.3 | Wong | | 3 | 180.17.95.4 | Lin | | 4 | 180.17.95.5 | Trump | +---------+----------------+----------+ else error

func Start

func Start(proxyHost, remoteHost string, filterCallback, returnCallBack parser.Callback)

Start proxy server needed receive and proxyHost, all the request or database's sql of receive will redirect to remoteHost.

Types

type Proxy

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

Proxy - Manages a Proxy connection, piping data between proxy and remote.

func New

func New(conn *net.TCPConn, proxyAddr, remoteAddr *net.TCPAddr, connid uint64) *Proxy

New - Create a new Proxy instance. Takes over local connection passed in, and closes it when finished.

Jump to

Keyboard shortcuts

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