outproxy

package module
v0.0.0-...-33f1668 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 12 Imported by: 2

README

outproxy

Don't use it yet.

This is a Go-based I2P outproxy configured over SAM. It is new, experimental, and was developed largely for completeness' sake, but it may be used to mix connections made by a cryptocurrency wallet soon.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAccessList

func SetAccessList(s []string) func(*OutProxy) error

SetAccessList tells the system to treat the accessList as a whitelist

func SetAccessListType

func SetAccessListType(s string) func(*OutProxy) error

SetAccessListType tells the system to treat the accessList as a whitelist

func SetAllowZeroIn

func SetAllowZeroIn(b bool) func(*OutProxy) error

SetAllowZeroIn tells the tunnel to accept zero-hop peers

func SetAllowZeroOut

func SetAllowZeroOut(b bool) func(*OutProxy) error

SetAllowZeroOut tells the tunnel to accept zero-hop peers

func SetBurst

func SetBurst(s int) func(*OutProxy) error

func SetByteLimit

func SetByteLimit(u int64) func(*OutProxy) error

SetByteLimit sets the number of hops inbound

func SetCloseIdle

func SetCloseIdle(b bool) func(*OutProxy) error

SetCloseIdle tells the connection to close it's tunnels during extended idle time.

func SetCloseIdleTime

func SetCloseIdleTime(u int) func(*OutProxy) error

SetCloseIdleTime sets the time to wait before closing tunnels to idle levels

func SetCloseIdleTimeMs

func SetCloseIdleTimeMs(u int) func(*OutProxy) error

SetCloseIdleTimeMs sets the time to wait before closing tunnels to idle levels in milliseconds

func SetCompress

func SetCompress(b bool) func(*OutProxy) error

SetCompress tells clients to use compression

func SetDomains

func SetDomains(s []string) func(*OutProxy) error

func SetEncrypt

func SetEncrypt(b bool) func(*OutProxy) error

SetEncrypt tells the router to use an encrypted leaseset

func SetFastRecieve

func SetFastRecieve(b bool) func(*OutProxy) error

SetFastRecieve tells clients to use compression

func SetFilePath

func SetFilePath(s string) func(*OutProxy) error

SetFilePath sets the path to save the config file at.

func SetHost

func SetHost(s string) func(*OutProxy) error

SetHost sets the host of the service to forward

func SetHttpAccessList

func SetHttpAccessList(s []string) func(*HttpOutProxy) error

SetHttpAccessList tells the system to treat the accessList as a whitelist

func SetHttpAccessListType

func SetHttpAccessListType(s string) func(*HttpOutProxy) error

SetHttpAccessListType tells the system to treat the accessList as a whitelist

func SetHttpAllowZeroIn

func SetHttpAllowZeroIn(b bool) func(*HttpOutProxy) error

SetHttpAllowZeroIn tells the tunnel to accept zero-hop peers

func SetHttpAllowZeroOut

func SetHttpAllowZeroOut(b bool) func(*HttpOutProxy) error

SetHttpAllowZeroOut tells the tunnel to accept zero-hop peers

func SetHttpCloseIdle

func SetHttpCloseIdle(b bool) func(*HttpOutProxy) error

SetHttpCloseIdle tells the connection to close it's tunnels during extended idle time.

func SetHttpCloseIdleTime

func SetHttpCloseIdleTime(u int) func(*HttpOutProxy) error

SetHttpCloseIdleTime sets the time to wait before closing tunnels to idle levels

func SetHttpCloseIdleTimeMs

func SetHttpCloseIdleTimeMs(u int) func(*HttpOutProxy) error

SetHttpCloseIdleTimeMs sets the time to wait before closing tunnels to idle levels in milliseconds

func SetHttpCompress

func SetHttpCompress(b bool) func(*HttpOutProxy) error

SetHttpCompress tells clients to use compression

func SetHttpEncrypt

func SetHttpEncrypt(b bool) func(*HttpOutProxy) error

SetHttpEncrypt tells the router to use an encrypted leaseset

func SetHttpFastRecieve

func SetHttpFastRecieve(b bool) func(*HttpOutProxy) error

SetHttpFastRecieve tells clients to use compression

func SetHttpFilePath

func SetHttpFilePath(s string) func(*HttpOutProxy) error

SetHttpFilePath sets the path to save the config file at.

func SetHttpHost

func SetHttpHost(s string) func(*HttpOutProxy) error

SetHttpHost sets the host of the service to forward

func SetHttpInBackups

func SetHttpInBackups(u int) func(*HttpOutProxy) error

SetHttpInBackups sets the inbound tunnel backups

func SetHttpInLength

func SetHttpInLength(u int) func(*HttpOutProxy) error

SetHttpInLength sets the number of hops inbound

func SetHttpInQuantity

func SetHttpInQuantity(u int) func(*HttpOutProxy) error

SetHttpInQuantity sets the inbound tunnel quantity

func SetHttpInVariance

func SetHttpInVariance(i int) func(*HttpOutProxy) error

SetHttpInVariance sets the variance of a number of hops inbound

func SetHttpKeyFile

func SetHttpKeyFile(s string) func(*HttpOutProxy) error

SetHttpKeyFile sets

func SetHttpLeaseSetKey

func SetHttpLeaseSetKey(s string) func(*HttpOutProxy) error

SetHttpLeaseSetKey sets the host of the HttpOutProxy's SAM bridge

func SetHttpLeaseSetPrivateKey

func SetHttpLeaseSetPrivateKey(s string) func(*HttpOutProxy) error

SetHttpLeaseSetPrivateKey sets the host of the HttpOutProxy's SAM bridge

func SetHttpLeaseSetPrivateSigningKey

func SetHttpLeaseSetPrivateSigningKey(s string) func(*HttpOutProxy) error

SetHttpLeaseSetPrivateSigningKey sets the host of the HttpOutProxy's SAM bridge

func SetHttpMessageReliability

func SetHttpMessageReliability(s string) func(*HttpOutProxy) error

SetHttpMessageReliability sets the host of the HttpOutProxy's SAM bridge

func SetHttpName

func SetHttpName(s string) func(*HttpOutProxy) error

SetHttpName sets the host of the HttpOutProxy's SAM bridge

func SetHttpOutBackups

func SetHttpOutBackups(u int) func(*HttpOutProxy) error

SetHttpOutBackups sets the inbound tunnel backups

func SetHttpOutLength

func SetHttpOutLength(u int) func(*HttpOutProxy) error

SetHttpOutLength sets the number of hops outbound

func SetHttpOutQuantity

func SetHttpOutQuantity(u int) func(*HttpOutProxy) error

SetHttpOutQuantity sets the outbound tunnel quantity

func SetHttpOutVariance

func SetHttpOutVariance(i int) func(*HttpOutProxy) error

SetHttpOutVariance sets the variance of a number of hops outbound

func SetHttpPort

func SetHttpPort(s string) func(*HttpOutProxy) error

SetHttpPort sets the port of the service to forward

func SetHttpReduceIdle

func SetHttpReduceIdle(b bool) func(*HttpOutProxy) error

SetHttpReduceIdle tells the connection to reduce it's tunnels during extended idle time.

func SetHttpReduceIdleQuantity

func SetHttpReduceIdleQuantity(u int) func(*HttpOutProxy) error

SetHttpReduceIdleQuantity sets minimum number of tunnels to reduce to during idle time

func SetHttpReduceIdleTime

func SetHttpReduceIdleTime(u int) func(*HttpOutProxy) error

SetHttpReduceIdleTime sets the time to wait before reducing tunnels to idle levels

func SetHttpReduceIdleTimeMs

func SetHttpReduceIdleTimeMs(u int) func(*HttpOutProxy) error

SetHttpReduceIdleTimeMs sets the time to wait before reducing tunnels to idle levels in milliseconds

func SetHttpSAMHost

func SetHttpSAMHost(s string) func(*HttpOutProxy) error

SetHttpSAMHost sets the host of the HttpOutProxy's SAM bridge

func SetHttpSAMPort

func SetHttpSAMPort(s string) func(*HttpOutProxy) error

SetHttpSAMPort sets the port of the HttpOutProxy's SAM bridge using a string

func SetHttpSaveFile

func SetHttpSaveFile(b bool) func(*HttpOutProxy) error

SetHttpSaveFile tells the router to save the tunnel's keys long-term

func SetHttpSigType

func SetHttpSigType(s string) func(*HttpOutProxy) error

SetHttpSigType sets the type of the forwarder server

func SetHttpType

func SetHttpType(s string) func(*HttpOutProxy) error

SetHttpType sets the type of the forwarder server

func SetIPs

func SetIPs(s []net.IP) func(*OutProxy) error

func SetInBackups

func SetInBackups(u int) func(*OutProxy) error

SetInBackups sets the inbound tunnel backups

func SetInLength

func SetInLength(u int) func(*OutProxy) error

SetInLength sets the number of hops inbound

func SetInQuantity

func SetInQuantity(u int) func(*OutProxy) error

SetInQuantity sets the inbound tunnel quantity

func SetInVariance

func SetInVariance(i int) func(*OutProxy) error

SetInVariance sets the variance of a number of hops inbound

func SetKeyFile

func SetKeyFile(s string) func(*OutProxy) error

SetKeyFile sets

func SetLeaseSetKey

func SetLeaseSetKey(s string) func(*OutProxy) error

SetLeaseSetKey sets the host of the OutProxy's SAM bridge

func SetLeaseSetPrivateKey

func SetLeaseSetPrivateKey(s string) func(*OutProxy) error

SetLeaseSetPrivateKey sets the host of the OutProxy's SAM bridge

func SetLeaseSetPrivateSigningKey

func SetLeaseSetPrivateSigningKey(s string) func(*OutProxy) error

SetLeaseSetPrivateSigningKey sets the host of the OutProxy's SAM bridge

func SetLimit

func SetLimit(s float64) func(*OutProxy) error

func SetMessageReliability

func SetMessageReliability(s string) func(*OutProxy) error

SetMessageReliability sets the host of the OutProxy's SAM bridge

func SetName

func SetName(s string) func(*OutProxy) error

SetName sets the host of the OutProxy's SAM bridge

func SetOutBackups

func SetOutBackups(u int) func(*OutProxy) error

SetOutBackups sets the inbound tunnel backups

func SetOutLength

func SetOutLength(u int) func(*OutProxy) error

SetOutLength sets the number of hops outbound

func SetOutQuantity

func SetOutQuantity(u int) func(*OutProxy) error

SetOutQuantity sets the outbound tunnel quantity

func SetOutVariance

func SetOutVariance(i int) func(*OutProxy) error

SetOutVariance sets the variance of a number of hops outbound

func SetPolicy

func SetPolicy(s bool) func(*OutProxy) error

func SetPort

func SetPort(s string) func(*OutProxy) error

SetPort sets the port of the service to forward

func SetPorts

func SetPorts(s []int) func(*OutProxy) error

func SetReduceIdle

func SetReduceIdle(b bool) func(*OutProxy) error

SetReduceIdle tells the connection to reduce it's tunnels during extended idle time.

func SetReduceIdleQuantity

func SetReduceIdleQuantity(u int) func(*OutProxy) error

SetReduceIdleQuantity sets minimum number of tunnels to reduce to during idle time

func SetReduceIdleTime

func SetReduceIdleTime(u int) func(*OutProxy) error

SetReduceIdleTime sets the time to wait before reducing tunnels to idle levels

func SetReduceIdleTimeMs

func SetReduceIdleTimeMs(u int) func(*OutProxy) error

SetReduceIdleTimeMs sets the time to wait before reducing tunnels to idle levels in milliseconds

func SetSAMHost

func SetSAMHost(s string) func(*OutProxy) error

SetSAMHost sets the host of the OutProxy's SAM bridge

func SetSAMPort

func SetSAMPort(s string) func(*OutProxy) error

SetSAMPort sets the port of the OutProxy's SAM bridge using a string

func SetSaveFile

func SetSaveFile(b bool) func(*OutProxy) error

SetSaveFile tells the router to save the tunnel's keys long-term

func SetSigType

func SetSigType(s string) func(*OutProxy) error

SetSigType sets the type of the forwarder server

func SetType

func SetType(s string) func(*OutProxy) error

SetType sets the type of the forwarder server

Types

type HttpOption

type HttpOption func(*HttpOutProxy) error

HttpOption is a HttpOutProxy Option

type HttpOutProxy

type HttpOutProxy struct {
	*samforwarder.SAMForwarder
	Prox *Proxy
	// contains filtered or unexported fields
}

HttpOutProxy is a SAM-based SOCKS outproxy you connect to with a regular TCP tunnel

func NewHttpOutProxyd

func NewHttpOutProxyd(host, port string) (*HttpOutProxy, error)

NewHttpOutProxyd makes a new SAM forwarder with default options, accepts host:port arguments

func NewHttpOutProxydFromOptions

func NewHttpOutProxydFromOptions(opts ...func(*HttpOutProxy) error) (*HttpOutProxy, error)

NewHttpOutProxydFromOptions makes a new SAM forwarder with default options, accepts host:port arguments

func (*HttpOutProxy) GetType

func (f *HttpOutProxy) GetType() string

func (*HttpOutProxy) Load

func (s *HttpOutProxy) Load() (samtunnel.SAMTunnel, error)

func (*HttpOutProxy) Serve

func (f *HttpOutProxy) Serve() error

Serve starts the SAM connection and and forwards the local host:port to i2p

func (*HttpOutProxy) ServeParent

func (f *HttpOutProxy) ServeParent()

type Option

type Option func(*OutProxy) error

Option is a OutProxy Option

type OutProxy

type OutProxy struct {
	*samforwarder.SAMForwarder
	Conf  *socks5.Config
	Socks *socks5.Server
	// contains filtered or unexported fields
}

OutProxy is a SAM-based SOCKS outproxy you connect to with a regular TCP tunnel

func NewOutProxy

func NewOutProxy(host, port string) (*OutProxy, error)

NewOutProxyd makes a new SAM forwarder with default options, accepts host:port arguments

func NewOutProxyFromOptions

func NewOutProxyFromOptions(opts ...func(*OutProxy) error) (*OutProxy, error)

NewOutProxydFromOptions makes a new SAM forwarder with default options, accepts host:port arguments

func (*OutProxy) Close

func (f *OutProxy) Close() error

Close shuts the whole thing down.

func (*OutProxy) GetType

func (f *OutProxy) GetType() string

func (*OutProxy) Load

func (s *OutProxy) Load() (samtunnel.SAMTunnel, error)

func (*OutProxy) Serve

func (f *OutProxy) Serve() error

Serve starts the SAM connection and and forwards the local host:port to i2p

func (*OutProxy) ServeParent

func (f *OutProxy) ServeParent()

type Proxy

type Proxy struct {
}

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(wr http.ResponseWriter, req *http.Request)

type SocksRuleSet

type SocksRuleSet struct {
	Ports   []int
	Domains []string
	IPs     []net.IP
	Rate    map[string]*rate.Limiter
	Limit   float64
	Burst   int

	Default bool
}

func (*SocksRuleSet) Allow

func (s *SocksRuleSet) Allow(ctx context.Context, req *socks5.Request) (context.Context, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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