i2pbrowserproxy

package
v0.0.0-...-1fa7301 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 22 Imported by: 0

README

BrowserProxy

This is emphatically unofficial and I did it in a night because http proxies are easy. It could do something you like. It could burn your house down. I strongly advise you to help me with it if you want something it does to become mainstream. Right now I'm a little worried about sanitization.

This is an HTTP Proxy for I2P which introduces new behavior in a configurable way, in particular, it is capable of controlling the creation and lifespan of a multiplex of small(1) tunnel pools, each corresponding to an I2P destination. What I've long ago elected to call destination isolation because in the context of I2P, the analogous terminology from Tor introduces confusion. The othert types of isolation from the Tor context largely already exist in I2P, and the remaining item of concern is the "Destination," primarily via it's relationship to the web browser.

It does not create a new destination for every single site by default. Instead it accepts Proxy-Authorization parameters, which are used to either spawn or select an HTTP client to use to forward messages to and from I2P. Each client has it's own destination. This could be used in a browser extension in conjunction with a Contextual-Identities type feature to isolate activities from eachother in a granular way. If passed no auth parameters, it will fall back to a "general" tunnel which behaves almost exactly as httptunnel in the parent directory or the http proxies in I2P and i2pd.

It also has an aggressive mode, which creates a whole new tunnel pool for every single eepSite you visit, by domain(which means that if you visit both the base32 and readable domain, it will create two destinations). I advise against using it.

Features: Done

  • Self-supervising, Self-restarting on Unixes
  • CONNECT support
  • "New Ident" signaling interface

Features: Planned

  • Outproxy Support
  • Traffic Shaping

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Quiet bool

Functions

func ProxyBasicAuth

func ProxyBasicAuth(r *http.Request) (username, password string, ok bool)

func SetAddr

func SetAddr(s ...string) func(*SAMMultiProxy) error

SetAddr sets a clients's address in the form host:port or host, port

func SetAddrMixed

func SetAddrMixed(s string, i int) func(*SAMMultiProxy) error

SetAddrMixed sets a clients's address in the form host, port(int)

func SetCompression

func SetCompression(b bool) func(*SAMMultiProxy) error

SetCompression sets the tunnels to close after a specific amount of time

func SetControlAddr

func SetControlAddr(s ...string) func(*SAMMultiProxy) error

SetControlAddr sets a clients's address in the form host:port or host, port

func SetControlHost

func SetControlHost(s string) func(*SAMMultiProxy) error

SetContrlHost sets the host of the client's Proxy Controller

func SetControlPort

func SetControlPort(s string) func(*SAMMultiProxy) error

SetContrlPort sets the host of the client's Proxy Controller

func SetDebug

func SetDebug(b bool) func(*SAMMultiProxy) error

SetDebug enables debugging messages

func SetEncrypt

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

SetEncrypt tells the router to use an encrypted leaseset

func SetHost

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

SetHost sets the host of the client's SAM bridge

func SetInBackups

func SetInBackups(u uint) func(*SAMMultiProxy) error

SetInBackups sets the inbound tunnel backups

func SetInLength

func SetInLength(u uint) func(*SAMMultiProxy) error

SetInLength sets the number of hops inbound

func SetInQuantity

func SetInQuantity(u uint) func(*SAMMultiProxy) error

SetInQuantity sets the inbound tunnel quantity

func SetInVariance

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

SetInVariance sets the variance of a number of hops inbound

func SetKeysPath

func SetKeysPath(s string) func(*SAMMultiProxy) error

SetKeysPath sets the path to the key save files

func SetName

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

SetName sets a clients's address in the form host:port or host, port

func SetOutBackups

func SetOutBackups(u uint) func(*SAMMultiProxy) error

SetOutBackups sets the inbound tunnel backups

func SetOutLength

func SetOutLength(u uint) func(*SAMMultiProxy) error

SetOutLength sets the number of hops outbound

func SetOutQuantity

func SetOutQuantity(u uint) func(*SAMMultiProxy) error

SetOutQuantity sets the outbound tunnel quantity

func SetOutVariance

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

SetOutVariance sets the variance of a number of hops outbound

func SetPort

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

SetPort sets the port of the client's SAM bridge using a string

func SetPortInt

func SetPortInt(i int) func(*SAMMultiProxy) error

SetPortInt sets the port of the client's SAM bridge using a string

func SetProxyAddr

func SetProxyAddr(s ...string) func(*SAMMultiProxy) error

SetProxyAddr sets a clients's address in the form host:port or host, port

func SetProxyMode

func SetProxyMode(b bool) func(*SAMMultiProxy) error

SetProxyMode tells whether to use per-ID or per-domain isolation

func SetReduceIdle

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

SetReduceIdle sets the created tunnels to be reduced during extended idle time to avoid excessive resource usage

func SetReduceIdleQuantity

func SetReduceIdleQuantity(u uint) func(*SAMMultiProxy) error

SetReduceIdleQuantity sets number of tunnels to keep alive during an extended idle period

func SetReduceIdleTime

func SetReduceIdleTime(u uint) func(*SAMMultiProxy) error

SetReduceIdleTime sets time to wait before the tunnel quantity is reduced

func SetUnpublished

func SetUnpublished(b bool) func(*SAMMultiProxy) error

SetUnpublished tells the router to not publish the client leaseset

Types

type Credentials

type Credentials struct {
	User string
	Site string
}

func DecodeIdentity

func DecodeIdentity(body *http.Request) (*http.Request, *Credentials, error)

type Option

type Option func(*SAMMultiProxy) error

Option is a client Option

type SAMMultiProxy

type SAMMultiProxy struct {
	Hasher *hashhash.Hasher

	Conf *i2ptunconf.Conf
	// contains filtered or unexported fields
}

func NewHttpProxy

func NewHttpProxy(opts ...func(*SAMMultiProxy) error) (*SAMMultiProxy, error)

func (*SAMMultiProxy) Base32

func (p *SAMMultiProxy) Base32() string

func (*SAMMultiProxy) Base32Readable

func (f *SAMMultiProxy) Base32Readable() string

Base32Readable returns the base32 address where the local service is being forwarded, but as a list of English words(More languages later if it works) instead of as a hash for person-to-person transmission.

func (*SAMMultiProxy) Base64

func (p *SAMMultiProxy) Base64() string

func (*SAMMultiProxy) Cleanup

func (p *SAMMultiProxy) Cleanup()

func (*SAMMultiProxy) Close

func (p *SAMMultiProxy) Close() error

func (*SAMMultiProxy) Config

func (f *SAMMultiProxy) Config() *i2ptunconf.Conf

func (*SAMMultiProxy) GetType

func (f *SAMMultiProxy) GetType() string

func (*SAMMultiProxy) ID

func (f *SAMMultiProxy) ID() string

func (*SAMMultiProxy) Keys

func (p *SAMMultiProxy) Keys() i2pkeys.I2PKeys

func (*SAMMultiProxy) Load

func (handler *SAMMultiProxy) Load() (samtunnel.SAMTunnel, error)

func (*SAMMultiProxy) Print

func (p *SAMMultiProxy) Print() string

func (*SAMMultiProxy) Props

func (f *SAMMultiProxy) Props() map[string]string

func (*SAMMultiProxy) Save

func (p *SAMMultiProxy) Save() string

func (*SAMMultiProxy) Search

func (p *SAMMultiProxy) Search(search string) string

func (*SAMMultiProxy) Serve

func (p *SAMMultiProxy) Serve() error

func (*SAMMultiProxy) ServeHTTP

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

func (*SAMMultiProxy) Signin

func (m *SAMMultiProxy) Signin(w http.ResponseWriter, r *http.Request) (*samClient, *http.Request)

func (*SAMMultiProxy) Target

func (p *SAMMultiProxy) Target() string

func (*SAMMultiProxy) Up

func (f *SAMMultiProxy) Up() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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