proxy

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 5 Imported by: 1

README

proxy

Some proxy implementations

Build Status GoDoc

Documentation

Overview

Package proxy provides wrappers around various proxy server implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol uint8

Protocol is a wrapper around uint8.

const (
	HTTP Protocol = iota
	HTTPS
	SOCKS5
	Unknown
)

Proxy protocol available.

func ParseProto

func ParseProto(s string) (Protocol, error)

ParseProto takes a string as input and returns its Protocol value, is one is recognised. Otherwise it returns an error.

type Proxy

type Proxy interface {
	// Protocol is the string representation of the protocol
	// beign used.
	Protocol() string
	// ListenAndServe reveleas the proxy to the network.
	ListenAndServe(ctx context.Context, port int) error
	// DialWith makes the proxy dial new connections with the
	// assigned dialer.
	DialWith(d dialer.Dialer)
}

Proxy explains how a proxy should behave.

func NewHTTP

func NewHTTP() (Proxy, error)

NewHTTP returns a new HTTP proxy instance that speaks the protocol assigned. d can also be nil, in that case the proxy will use a default dialer, usually a bare net.Dialer.

func NewSOCKS5

func NewSOCKS5() (Proxy, error)

NewSOCKS5 returns a new SOCKS5 proxy instance that speaks the protocol assigned. d can also be nil, in that case the proxy will use a default dialer, usually a bare net.Dialer.

Directories

Path Synopsis
cmd
Package dialer provides utility functions related to dialers.
Package dialer provides utility functions related to dialers.
Package http provides a http proxy implementation.
Package http provides a http proxy implementation.
Package socks5 provides a SOCKS5 server implementation.
Package socks5 provides a SOCKS5 server implementation.
Package transmit provides utility functions to proxy data through network connections, with control over timeouts.
Package transmit provides utility functions to proxy data through network connections, with control over timeouts.

Jump to

Keyboard shortcuts

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