transport

package module
v2.0.131 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 51

README

Ziti Transport Library

This library provides connection abstractions which are bundled with an identity. The identity generally has certificates.

Documentation

Index

Constants

View Source
const (
	KeyProxy                    = "proxy"
	KeyProtocol                 = "protocol"
	KeyCachedProxyConfiguration = "cachedProxyConfiguration"
)
View Source
const (
	DefaultWsWriteTimeout      = time.Second * 10
	DefaultWsReadTimeout       = time.Second * 5
	DefaultWsIdleTimeout       = time.Second * 120
	DefaultWsPongTimeout       = time.Second * 60
	DefaultWsPingInterval      = (DefaultWsPongTimeout * 9) / 10
	DefaultWsHandshakeTimeout  = time.Second * 10
	DefaultWsReadBufferSize    = 4096
	DefaultWsWriteBufferSize   = 4096
	DefaultWsEnableCompression = true
)

Variables

This section is empty.

Functions

func AddAddressParser

func AddAddressParser(addressParser AddressParser)

AddAddressParser adds an AddressParser to the globally-configured address parsers.

func NewDialerWithLocalBinding

func NewDialerWithLocalBinding(addressType string, timeout time.Duration, localBinding string) (*net.Dialer, error)

NewDialerWithLocalBinding creates a dialer and sets the local ip used for dialing

func ResolveInterface

func ResolveInterface(toResolve string) (*net.Interface, error)

Resolve a network interface by name or IP address

func ResolveLocalBinding

func ResolveLocalBinding(localBinding string) (net.IP, error)

Types

type Address

type Address interface {
	Dial(name string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error)
	DialWithLocalBinding(name string, binding string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error)
	Listen(name string, i *identity.TokenId, acceptF func(Conn), tcfg Configuration) (io.Closer, error)
	MustListen(name string, i *identity.TokenId, acceptF func(Conn), tcfg Configuration) io.Closer
	String() string
	Type() string
}

Address implements the functionality provided by a generic "address".

func ParseAddress

func ParseAddress(addressString string) (Address, error)

ParseAddress uses the globally-configured AddressParser instances to parse an address.

type AddressParser

type AddressParser interface {
	Parse(addressString string) (Address, error)
}

AddressParser implements the functionality provided by an "address parser".

type Configuration

type Configuration map[interface{}]interface{}

func (Configuration) GetProxyConfiguration added in v2.0.100

func (self Configuration) GetProxyConfiguration() (*ProxyConfiguration, error)

func (Configuration) Protocols added in v2.0.95

func (self Configuration) Protocols() []string

Protocols returns supported or requested application protocols (used for ALPN support)

type Conn

type Conn interface {
	Detail() *ConnectionDetail
	PeerCertificates() []*x509.Certificate
	net.Conn
}

Conn represents an abstract connection

type ConnectionDetail

type ConnectionDetail struct {
	Address string
	InBound bool
	Name    string
}

func (*ConnectionDetail) String

func (cd *ConnectionDetail) String() string

type HostPortAddress added in v2.0.94

type HostPortAddress interface {
	Address
	Hostname() string
	Port() uint16
}

type ProxyConfiguration added in v2.0.100

type ProxyConfiguration struct {
	Type    ProxyType
	Address string
	Auth    *proxy.Auth
}

func LoadProxyConfiguration added in v2.0.100

func LoadProxyConfiguration(cfg map[interface{}]interface{}) (*ProxyConfiguration, error)

type ProxyType added in v2.0.100

type ProxyType string
const (
	ProxyTypeNone        ProxyType = "none"
	ProxyTypeHttpConnect ProxyType = "http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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