accessregister

package module
v0.0.0-...-2f83369 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

README

accessregister

A registration interface for I2P service tunnels

This is a prototype of a sort of "Compound" tunnel type. It uses two tunnels, together, to provide private access to a service via a public registration interface. In it's current form, the private service and the public registration interface have different addresses, and I'm pretty sure that is a requirement. The point is to use this registration tunnel to add, remove, administer, and track i2ptunnl access list members as a form of "login" for services like VPN's and outproxies especially.

This implementation of an Access Register i2ptunnel in Go is "composed" of a samtunnel.SAMTunnel, which is a generic interface that can be used like any i2ptunnel and a samforwarder.SAMForwarder running with as an httpserver which emulates the functionality of an i2ptunnel HTTP Server tunnel.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAccessList

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

SetAccessList tells the system to treat the accessList as a whitelist

func SetAccessListType

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

SetAccessListType tells the system to treat the accessList as a whitelist

func SetAllowZeroIn

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

SetAllowZeroIn tells the tunnel to accept zero-hop peers

func SetAllowZeroOut

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

SetAllowZeroOut tells the tunnel to accept zero-hop peers

func SetCloseIdle

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

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

func SetCloseIdleTime

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

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

func SetCloseIdleTimeMs

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

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

func SetCompress

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

SetCompress tells clients to use compression

func SetEncrypt

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

SetEncrypt tells the router to use an encrypted leaseset

func SetFastRecieve

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

SetFastRecieve tells clients to use compression

func SetFilePath

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

SetFilePath sets the path to save the config file at.

func SetHost

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

SetHost sets the host of the service to forward

func SetInBackups

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

SetInBackups sets the inbound tunnel backups

func SetInLength

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

SetInLength sets the number of hops inbound

func SetInQuantity

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

SetInQuantity sets the inbound tunnel quantity

func SetInVariance

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

SetInVariance sets the variance of a number of hops inbound

func SetKeyFile

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

SetKeyFile sets

func SetLeaseSetKey

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

SetLeaseSetKey sets the host of the AccessTunnel's SAM bridge

func SetLeaseSetPrivateKey

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

SetLeaseSetPrivateKey sets the host of the AccessTunnel's SAM bridge

func SetLeaseSetPrivateSigningKey

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

SetLeaseSetPrivateSigningKey sets the host of the AccessTunnel's SAM bridge

func SetMessageReliability

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

SetMessageReliability sets the host of the AccessTunnel's SAM bridge

func SetName

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

SetName sets the host of the AccessTunnel's SAM bridge

func SetOutBackups

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

SetOutBackups sets the inbound tunnel backups

func SetOutLength

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

SetOutLength sets the number of hops outbound

func SetOutQuantity

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

SetOutQuantity sets the outbound tunnel quantity

func SetOutVariance

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

SetOutVariance sets the variance of a number of hops outbound

func SetPort

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

SetPort sets the port of the service to forward

func SetReduceIdle

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

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

func SetReduceIdleQuantity

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

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

func SetReduceIdleTime

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

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

func SetReduceIdleTimeMs

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

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

func SetSAMHost

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

SetSAMHost sets the host of the AccessTunnel's SAM bridge

func SetSAMPort

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

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

func SetSaveFile

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

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

func SetSigType

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

SetSigType sets the type of the forwarder server

func SetType

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

SetType sets the type of the forwarder server

Types

type AccessTunnel

type AccessTunnel struct {
	samtunnel.SAMTunnel
	*samforwarder.SAMForwarder
	*i2ptunconf.Conf
	Whitelister []whitelister.WhiteLister
	// contains filtered or unexported fields
}

AccessTunnel is a SAM-based generic tunnel accompanied by an HTTP-over-SAM based registrar of base64 public keys to use as a whitelist.

func NewAccessTunnel

func NewAccessTunnel(host, port string) (*AccessTunnel, error)

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

func NewAccessTunnelFromOptions

func NewAccessTunnelFromOptions(opts ...func(*AccessTunnel) error) (*AccessTunnel, error)

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

func (*AccessTunnel) Base32

func (f *AccessTunnel) Base32() string

Base32 returns the base32 address where the local service is being forwarded

func (*AccessTunnel) Base32Readable

func (f *AccessTunnel) Base32Readable() string

Base32Readable returns the base32 address where the local service is being forwarded

func (*AccessTunnel) Base64

func (f *AccessTunnel) Base64() string

Base64 returns the base64 address where the local service is being forwarded

func (*AccessTunnel) Check

func (f *AccessTunnel) Check(requestBytesOrString interface{}) (string, interface{}, bool)

func (*AccessTunnel) Cleanup

func (f *AccessTunnel) Cleanup()

func (*AccessTunnel) Close

func (f *AccessTunnel) Close() error

Close shuts the whole thing down.

func (*AccessTunnel) Config

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

func (*AccessTunnel) GetType

func (f *AccessTunnel) GetType() string

func (*AccessTunnel) ID

func (f *AccessTunnel) ID() string

func (*AccessTunnel) Keys

func (f *AccessTunnel) Keys() i2pkeys.I2PKeys

func (*AccessTunnel) Load

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

func (*AccessTunnel) Print

func (f *AccessTunnel) Print() string

func (*AccessTunnel) Props

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

func (*AccessTunnel) Search

func (f *AccessTunnel) Search(search string) string

func (*AccessTunnel) Serve

func (f *AccessTunnel) Serve() error

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

func (*AccessTunnel) ServeHTTP

func (f *AccessTunnel) ServeHTTP(rw http.ResponseWriter, rq *http.Request)

func (*AccessTunnel) ServeParent

func (f *AccessTunnel) ServeParent()

func (*AccessTunnel) ServeRegistrar

func (f *AccessTunnel) ServeRegistrar()

func (*AccessTunnel) Target

func (f *AccessTunnel) Target() string

Target returns the host:port of the local service you want to forward to i2p

func (*AccessTunnel) Up

func (f *AccessTunnel) Up() bool

func (*AccessTunnel) Whitelist

func (f *AccessTunnel) Whitelist() []string

type Option

type Option func(*AccessTunnel) error

Option is a AccessTunnel Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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