proxy

package
v0.0.0-...-2cba37e Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package proxy implements a Tor onion service in front of an InfluxDB instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

Proxy is a Tor onion service in front of an InfluxDB instance.

func New

func New(ctx context.Context, key crypto.PrivateKey, backend string) (*Proxy, error)

New creates a Tor onion service for a backing InfluxDB.

func (*Proxy) Close

func (p *Proxy) Close() error

Close terminates the onion service and Tor gateway.

func (*Proxy) ID

func (p *Proxy) ID() string

URL retrieves the onion URL of the proxy.

func (*Proxy) Serve

func (p *Proxy) Serve() error

Serve accepts incoming connections, creating a new service goroutine for each. The service goroutines read requests and forward them to the configured Influx instance.

Serve always returns a non-nil error and closes its Tor gateway.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP proxies an inbound HTTP request to the backing InfluxDB instance, forwarding the reply back to the client.

Jump to

Keyboard shortcuts

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