rproxy

package
v0.0.0-...-6376860 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRPReader

func NewRPReader(r io.Reader, v bool) io.Reader

NewRPReader creates the new RPReader from an io.Reader.

func NewRPWriteCloser

func NewRPWriteCloser(wc io.WriteCloser) io.WriteCloser

NewRPWriteCloser creates the new RPWriteCloser from an io.WriteCloser.

Types

type RPReader

type RPReader struct {
	Reader io.Reader
	// contains filtered or unexported fields
}

RPReader defines a customized Reader, which is used to log data.

func (*RPReader) Read

func (r *RPReader) Read(p []byte) (n int, err error)

Read reads data from the reader.

type RPWriteCloser

type RPWriteCloser struct {
	Writer io.Writer
	Closer io.Closer
}

RPWriteCloser defines a customized WriteCloser, which is used to modify data.

func (*RPWriteCloser) Close

func (r *RPWriteCloser) Close() error

Close closes the connection.

func (*RPWriteCloser) Write

func (r *RPWriteCloser) Write(p []byte) (int, error)

Write writes data to the writer.

type RProxy

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

RProxy is used to store configurations of the reverse proxy and start running the proxy.

func NewRProxy

func NewRProxy(listenProto, listenAddr, backendProto, backendAddr, rootCert, serverCert, serverKey, clientCert, clientKey, serverName string) *RProxy

NewRProxy creates an RProxy instance.

func NewRProxyWithoutCerts

func NewRProxyWithoutCerts(listenProto, listenAddr, backendProto, backendAddr string) *RProxy

NewRProxyWithoutCerts creates an RProxy instance without setting certificate files, which is used in pure TCP setting or set the TLS configuration later.

func (*RProxy) SetClientConfig

func (rp *RProxy) SetClientConfig(config *tls.Config)

SetClientConfig sets the config for client (backend TLS).

func (*RProxy) SetServerConfig

func (rp *RProxy) SetServerConfig(config *tls.Config)

SetServerConfig sets the config for server (listen TLS).

func (*RProxy) SetVerbose

func (rp *RProxy) SetVerbose(v bool)

SetVerbose sets the verbose mode, which prints all the data sent and received.

func (*RProxy) Start

func (rp *RProxy) Start() error

Start starts the reverse proxy service.

Jump to

Keyboard shortcuts

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