circuit

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circuit

type Circuit struct {
	Chain []Knot
}

Circuit are reduced to forwarding a end of chain service over multiple proxies

For example:

## The user knows these proxy servers

- Server 1: SOCKS-5 - Server 2: Forward - Server 3: HTTP - Server 4: Forward - Server 5: SSH - Server 6: SOCKS-5

- Service

## The user then design a circuit to connect to a service that is only accesible by "Server 6"

Client -> Server 1 -> Server 2 -> Server 3 -> Server 4 -> Server 5 -> Server 6 -> Service

This way the user end Pivoting over the entire proxy chain to finally arrive it's requested service

## Server accesibility

To allow Randomness and unpredictibility in the proxy chain outgoing connections, it is also possible to set Server accesibility

Using the previus chain, but adding accesible annotation

- Server 1: SOCKS-5 -- accessible: --- Server 3 --- Server 5 --- Server 6 - Server 2: Forward - Server 3: HTTP -- accessible: --- Server 1 --- Server 5 --- Server 6 - Server 4: Forward - Server 5: SSH -- accessible: --- Server 1 --- Server 3 --- Server 6 - Server 6: SOCKS-5 -- accessible: --- Server 1 --- Server 5 - Service -- accessible: --- Server 1 --- Server 3 --- Server 5 --- Server 6

Now the chain will be reconstructed every accepted connection, ensuring randomness in the knots

# First connection Client -> Server 1 -> Server 2 -> Server 3 -> Server 4 -> Server 5 -> Server 6 -> Service

Second connection

Client -> Server 3 -> Server 1 -> Server 4 -> Server 6 -> Server 2 -> Server 5 -> Service

func (*Circuit) Dial

func (c *Circuit) Dial(n, addr string) (net.Conn, error)

type Conn

type Conn struct {
	CloseFunctions []network.CloseFunc
	net.Conn
}

func (*Conn) Close

func (c *Conn) Close() (err error)

type Dialer

type Dialer struct {
	DialFunc network.DialFunc
}

func (*Dialer) Dial

func (d *Dialer) Dial(network, address string) (net.Conn, error)

type Forward

type Forward struct {
	Network string
	Address string
}

func (*Forward) Next

func (f *Forward) Next(dial network.DialFunc) (closeFunc network.CloseFunc, newDial network.DialFunc, err error)

type Knot

type Knot interface {
	Next(dial network.DialFunc) (network.CloseFunc, network.DialFunc, error)
}

type SSH

type SSH struct {
	Network string
	Address string
	Config  ssh.ClientConfig
}

func (*SSH) Next

func (s *SSH) Next(dial network.DialFunc) (closeFunc network.CloseFunc, newDial network.DialFunc, err error)

type Socks5

type Socks5 struct {
	Network string
	Address string
	Auth    *proxy.Auth
}

func (*Socks5) Next

func (s *Socks5) Next(dial network.DialFunc) (closeFunc network.CloseFunc, newDial network.DialFunc, err error)

Jump to

Keyboard shortcuts

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