upstream

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCreateConnection added in v2.1.0

func DefaultCreateConnection(remote net.Addr, block kcp.BlockCrypt) (net.Conn, error)

DefaultCreateConnection will create a packet connection over UDP using KCP

Types

type ConnectionFromPacketConn added in v2.1.0

type ConnectionFromPacketConn func(remote net.Addr, block kcp.BlockCrypt) (net.Conn, error)

type Dns added in v2.1.0

type Dns struct {
	streams.Connection

	// Address is the parsed representation of the address and calculated automatically while unmarshalling
	Address addr.ProtoAddress
}

Dns will create a client which will establish a SocketAce connection via DNS request-response loop. This is not the fastest nor the most optimal way to establish connections. It is, however, the only way to do it in some cases. You won't be able to stream movies, but this should be sufficient to connect to a remote terminal session, check your email and do some light browsing.

DNS connections are a bit more complex as a lot of probing needs to be done before the connection is established. The steps to establish a DNS connection are as follows: - Try connecting directly via TCP to our target host (if direct connection is allowed). Failing that, - Try connecting directly via UDP to our target host. Failing that, - Use user supplied DNS servers, if they are available. And finally, - Use the system provided DNS servers

func (*Dns) Connect added in v2.1.0

func (ups *Dns) Connect(manager cert.TlsConfig, mustSecure bool) error

func (*Dns) String added in v2.1.0

func (ups *Dns) String() string

type Http

type Http struct {
	streams.Connection

	// Address is the parsed representation of the address and calculated automatically while unmarshalling
	Address addr.ProtoAddress
}

Http will establish a connection with the server over HTTP

func (*Http) Connect

func (ups *Http) Connect(manager cert.TlsConfig, mustSecure bool) error

func (*Http) String

func (ups *Http) String() string

type InputOutput

type InputOutput struct {
	streams.Connection

	// Address is the parsed representation of the address and calculated automatically while unmarshalling
	Address addr.ProtoAddress

	Input  io.ReadCloser
	Output io.WriteCloser
}

InputOutput is a connection which connects via standard input / output to the server

func (*InputOutput) Connect

func (ups *InputOutput) Connect(manager cert.TlsConfig, mustSecure bool) error

func (*InputOutput) String

func (ups *InputOutput) String() string

type Packet added in v2.1.0

type Packet struct {
	streams.Connection

	// Address is the parsed representation of the address and calculated automatically while unmarshalling
	Address addr.ProtoAddress
}

Socket connects to the server via a socket connection

func (*Packet) Connect added in v2.1.0

func (ups *Packet) Connect(manager cert.TlsConfig, mustSecure bool) error

Connect will create a stream over packet connection and use the DefaultCreateConnection to do so.

func (*Packet) ConnectPacket added in v2.1.0

func (ups *Packet) ConnectPacket(manager cert.TlsConfig, mustSecure bool, connectFunc ConnectionFromPacketConn) error

ConnectPacket will create a stream over a packet connection. It will take the supplied connectFunc to actually "cast" the packet connection into a net.Conn. This is to allow pluggable mechanism of underlying packet translation service.

func (*Packet) String added in v2.1.0

func (ups *Packet) String() string

type Socket

type Socket struct {
	streams.Connection

	// Address is the parsed representation of the address and calculated automatically while unmarshalling
	Address addr.ProtoAddress
}

Socket connects to the server via a socket connection

func (*Socket) Connect

func (ups *Socket) Connect(manager cert.TlsConfig, mustSecure bool) error

func (*Socket) String

func (ups *Socket) String() string

type Upstream

type Upstream interface {
	streams.Connection
	Connect(manager cert.TlsConfig, mustSecure bool) error
}

Upstream adds the Connect method to connect to the upstream

type Upstreams

type Upstreams struct {
	Data       []Upstream
	MustSecure bool // If MustSecure is true, non-secured sessions are not tolerated
	// contains filtered or unexported fields
}

Upstreams is a list of upstream servers

func (*Upstreams) Connect

func (ul *Upstreams) Connect(config cert.ConfigGetter, subProtocol string) (streams.ReadWriteCloserClosed, error)

Connect will return a mutex stream to the first upstream available. If an upstream connection is already opened, it will be reused -- only one physical connection will be opened against the server, no matter how many logical connections you start.

func (*Upstreams) Shutdown

func (ul *Upstreams) Shutdown()

Shutdown will close the connection to the connected upstream server

func (*Upstreams) UnmarshalFlag

func (ul *Upstreams) UnmarshalFlag(endpoint string) error

Jump to

Keyboard shortcuts

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