rstream

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

README

TODO

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Channel = "dev"
	Version = "development"
	OS      = runtime.GOOS
	Arch    = runtime.GOARCH
)

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func FormatForwardedAddr

func FormatForwardedAddr(addr net.TCPAddr, props TunnelProperties) (string, error)

func FormatForwardingAddr

func FormatForwardingAddr(props TunnelProperties) (string, error)

func StrOrUndef

func StrOrUndef(s *string) string

func StringPtr

func StringPtr(s string) *string

func Uint16Ptr

func Uint16Ptr(u uint16) *uint16

Types

type Addr

type Addr struct {
	IdOrName string
}

func (*Addr) Network

func (ta *Addr) Network() string

func (*Addr) String

func (ta *Addr) String() string

type BytestreamTunnel

type BytestreamTunnel interface {
	Tunnel
	net.Listener
}

type Client

type Client struct {
	ConfigFilePath  *string
	Transport       Dialer
	TLSClientConfig *tls.Config
	EngineURL       *string
	Token           *string
	NoToken         *bool
	ZeroRTT         *bool
}

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, cfg *Config) (ControlChannel, error)

func (*Client) Dial

func (c *Client) Dial(ctx context.Context, raddr Addr) (net.Conn, error)

func (*Client) PacketDial

func (c *Client) PacketDial(ctx context.Context, raddr Addr) (net.PacketConn, error)

type Config

type Config struct {
	EnableHeartbeat   *bool
	HeartbeatInterval *time.Duration
}

type ControlChannel

type ControlChannel interface {
	CreateTunnel(ctx context.Context, props TunnelProperties) (Tunnel, error)
	Close() error
	Done() <-chan error
	Err() error
}

type DatagramTunnel

type DatagramTunnel interface {
	Tunnel
	net.PacketConn
}

type Dialer

type Dialer interface {
	Dial(ctx context.Context, addr string, tlsCfg *tls.Config) (net.Conn, error)
}

type HTTPVersion

type HTTPVersion string
const (
	HTTP1_1 HTTPVersion = "http/1.1" // HTTP/1.1 (cleartext)
	HTTP2   HTTPVersion = "h2c"      // HTTP/2 (cleartext)
	HTTP3   HTTPVersion = "h3"       // HTTP/3
)

func HTTPVersionPtr

func HTTPVersionPtr(h HTTPVersion) *HTTPVersion

type Listener

type Listener struct {
	Client                *Client
	Config                *Config
	TunnelProperties      *TunnelProperties
	AutoReconnect         *bool
	ReconnectTimeout      *time.Duration
	AutoRecreateTunnel    *bool
	RecreateTunnelTimeout *time.Duration
	AcceptQueueSize       *int
	OnListenerInfo        func(ListenerInfo)
	// contains filtered or unexported fields
}

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) Close

func (l *Listener) Close() error

type ListenerInfo

type ListenerInfo struct {
	Status            *string
	ForwardingAddress *string
	TunnelProperties  *TunnelProperties
}

type Protocol

type Protocol string
const (
	ProtocolTLS  Protocol = "tls"  // bytestream
	ProtocolDTLS Protocol = "dtls" // datagram
	ProtocolQUIC Protocol = "quic" // datagram
	ProtocolHTTP Protocol = "http" // bytestream (HTTP/1.1, HTTP/2) or datagram (HTTP/3)
)

func ProtocolPtr

func ProtocolPtr(p Protocol) *Protocol

type TLSMode

type TLSMode string
const (
	TLSModePassthrough TLSMode = "passthrough" // For TLS tunnels only
	TLSModeTerminated  TLSMode = "terminated"
)

func TLSModePtr

func TLSModePtr(t TLSMode) *TLSMode

type Transport

type Transport struct {
	LocalAddr        *string
	NetworkInterface *string
	ForceIPv4        *bool
	ForceIPv6        *bool
	DNSOverride      *string
	MPTCPEnabled     *bool
	ProxyHTTP        *string
	ProxyUsername    *string
	ProxyPassword    *string
	ProxyHTTPHeaders map[string]string
	TLSProxyConfig   *tls.Config
}

Default transport implementation

func (*Transport) Dial

func (d *Transport) Dial(ctx context.Context, addr string, tlsCfg *tls.Config) (net.Conn, error)

type Tunnel

type Tunnel interface {
	ForwardingAddress() (string, error)
	Properties() (TunnelProperties, error)
	Close() error
}

type TunnelProperties

type TunnelProperties struct {
	// Basic tunnel properties
	ID           *string
	Name         *string
	CreationDate *time.Time

	// Tunnel options
	Type     *TunnelType
	Publish  *bool
	Protocol *Protocol // Only for published tunnels
	Labels   map[string]string

	// Security options
	GeoIP      []string
	TrustedIPs []string
	Domain     *string // Only for published tunnels

	// TLS options
	TLSMode       *TLSMode // Passthorugh is only supported for TLS tunnels
	TLSALPNs      []string
	TLSMinVersion *uint16
	TLSCiphers    []uint16
	MTLS          *bool
	MTLSCACertPEM *string

	// HTTP tunnel options (only for HTTP tunnels)
	HTTPVersion    *HTTPVersion
	HTTPUseTLS     *bool // Only for HTTP/1.1 and HTTP/2 (bytestream)
	TokenAuth      *bool
	SSO            *bool
	SSOProviders   []string
	EmailWhitelist []string
	EmailBlacklist []string
	Challenge      *bool
}

type TunnelType

type TunnelType string
const (
	TunnelBytestream TunnelType = "bytestream"
	TunnelDatagram   TunnelType = "datagram"
)

func TunnelTypePtr

func TunnelTypePtr(t TunnelType) *TunnelType

Directories

Path Synopsis
cmd
rstream command
examples
http-dial-h1 command
http-dial-h2 command
http-dial-h3 command
http-dial-tls command
http-tunnel-h1 command
http-tunnel-h2 command
http-tunnel-h3 command
http-tunnel-tls command
pb

Jump to

Keyboard shortcuts

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