Documentation
¶
Index ¶
- Variables
- func BoolPtr(b bool) *bool
- func CompiletimeArch() string
- func CompiletimeOS() string
- func FormatForwardedAddr(addr net.TCPAddr, props TunnelProperties) (string, error)
- func FormatForwardedHostPort(host, port string, props TunnelProperties) (string, error)
- func FormatForwardingAddr(props TunnelProperties) (string, error)
- func MatchPermissions(props *TunnelProperties, raw []byte, action string) (bool, error)
- func NetIPFromPbValue(ip *pb.IpAddress) net.IP
- func PacketConnFromConn(c net.Conn, raddr net.Addr, mode PacketMode) net.PacketConn
- func PacketConnFromDTLSConn(c *dtls.Conn) net.PacketConn
- func PacketConnFromPacketListener(l PacketListener) net.PacketConn
- func RuntimeArch() string
- func RuntimeOS() string
- func StrOrUndef(s *string) string
- func StringPtr(s string) *string
- func Uint16Ptr(u uint16) *uint16
- func Uint32ToIPv4(ip uint32) net.IP
- type Addr
- type BytestreamTunnel
- type Client
- func (c *Client) Connect(ctx context.Context, cfg *Config) (ControlChannel, error)
- func (c *Client) Dial(ctx context.Context, raddr Addr) (net.Conn, error)
- func (c *Client) GetTunnel(ctx context.Context, id string) (*TunnelProperties, error)
- func (c *Client) ListClients(ctx context.Context, params *ListClientsParams) (*ListClientsResponse, error)
- func (c *Client) ListTunnels(ctx context.Context, params *ListTunnelsParams) (*ListTunnelsResponse, error)
- func (c *Client) Login(ctx context.Context) (*string, error)
- func (c *Client) Logout(ctx context.Context) (*string, error)
- func (c *Client) PacketDial(ctx context.Context, raddr Addr) (net.PacketConn, error)
- func (c *Client) Watch(ctx context.Context, transport string, params *WatchParams, ...) error
- func (c *Client) WatchSSE(ctx context.Context, params *WatchParams, handler func(Event) error) error
- func (c *Client) WatchWS(ctx context.Context, params *WatchParams, handler func(Event) error) error
- type ClientDetails
- type ClientOptions
- type ClientProperties
- type Config
- type ControlChannel
- type CreateTURNCredentialsOptions
- type DatagramTunnel
- type Dialer
- type Event
- type HTTPVersion
- type Identity
- type ListClientsFilters
- type ListClientsParams
- type ListClientsResponse
- type ListTunnelsFilters
- type ListTunnelsParams
- type ListTunnelsResponse
- type PacketListener
- type PacketMode
- type Protocol
- type ServerDetails
- type TLSMode
- type TURNCredentialMode
- type TURNCredentials
- type Transport
- type Tunnel
- type TunnelInventory
- type TunnelProperties
- type TunnelType
- type WatchParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Agent = "rstream" Channel = "dev" Version = "development" OS = "" Arch = "" )
Functions ¶
func CompiletimeArch ¶ added in v1.3.2
func CompiletimeArch() string
CompiletimeArch returns the arch value embedded at build time.
func CompiletimeOS ¶ added in v1.3.2
func CompiletimeOS() string
CompiletimeOS returns the OS value embedded at build time.
func FormatForwardedAddr ¶
func FormatForwardedAddr(addr net.TCPAddr, props TunnelProperties) (string, error)
func FormatForwardedHostPort ¶ added in v1.2.0
func FormatForwardedHostPort(host, port string, props TunnelProperties) (string, error)
func FormatForwardingAddr ¶
func FormatForwardingAddr(props TunnelProperties) (string, error)
func MatchPermissions ¶ added in v1.2.0
func MatchPermissions(props *TunnelProperties, raw []byte, action string) (bool, error)
func PacketConnFromConn ¶ added in v1.2.0
func PacketConnFromConn(c net.Conn, raddr net.Addr, mode PacketMode) net.PacketConn
func PacketConnFromDTLSConn ¶ added in v1.2.0
func PacketConnFromDTLSConn(c *dtls.Conn) net.PacketConn
func PacketConnFromPacketListener ¶ added in v1.2.0
func PacketConnFromPacketListener(l PacketListener) net.PacketConn
func RuntimeArch ¶ added in v1.3.2
func RuntimeArch() string
RuntimeArch returns the arch detected at runtime.
func RuntimeOS ¶ added in v1.3.2
func RuntimeOS() string
RuntimeOS returns the OS detected at runtime.
func StrOrUndef ¶
func Uint32ToIPv4 ¶ added in v1.2.0
Types ¶
type BytestreamTunnel ¶
type Client ¶
type Client struct {
Transport Dialer
TLSClientConfig *tls.Config
EngineURL *string
Token *string
NoToken *bool
ZeroRTT *bool
}
func NewClient ¶ added in v1.3.0
func NewClient(options ClientOptions) (*Client, error)
func (*Client) ListClients ¶ added in v1.8.0
func (c *Client) ListClients(ctx context.Context, params *ListClientsParams) (*ListClientsResponse, error)
func (*Client) ListTunnels ¶ added in v1.2.0
func (c *Client) ListTunnels(ctx context.Context, params *ListTunnelsParams) (*ListTunnelsResponse, error)
func (*Client) PacketDial ¶
type ClientDetails ¶ added in v1.3.2
type ClientOptions ¶ added in v1.3.0
type ClientProperties ¶ added in v1.8.0
type ClientProperties struct {
ID string `json:"id"`
Status string `json:"status"`
UserID *string `json:"user_id,omitempty"`
WorkspaceID *string `json:"workspace_id,omitempty"`
ProjectID *string `json:"project_id,omitempty"`
ClusterID *string `json:"cluster_id,omitempty"`
Plan *string `json:"plan,omitempty"`
Provider *string `json:"provider,omitempty"`
Region *string `json:"region,omitempty"`
Agent *string `json:"agent,omitempty"`
Channel *string `json:"channel,omitempty"`
Version *string `json:"version,omitempty"`
OS *string `json:"os,omitempty"`
Arch *string `json:"arch,omitempty"`
ProtocolVersion *string `json:"protocol_version,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
type ControlChannel ¶
type ControlChannel interface {
CreateTunnel(ctx context.Context, props TunnelProperties) (Tunnel, error)
Close() error
Done() <-chan error
Err() error
ServerDetails() *ServerDetails
}
type CreateTURNCredentialsOptions ¶ added in v1.10.0
type DatagramTunnel ¶
type DatagramTunnel interface {
Tunnel
PacketListener
}
type Event ¶ added in v1.2.0
type Event struct {
Type string `json:"type"`
Object json.RawMessage `json:"object"`
}
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 Identity ¶ added in v1.3.2
Identity represents the OS/arch pair.
func CompiletimeIdentity ¶ added in v1.3.2
func CompiletimeIdentity() Identity
CompiletimeIdentity returns the OS/arch values embedded at build time.
func RuntimeIdentity ¶ added in v1.3.2
func RuntimeIdentity() Identity
RuntimeIdentity returns the OS/arch detected at runtime.
type ListClientsFilters ¶ added in v1.8.0
type ListClientsFilters struct {
ID *string `json:"id,omitempty"`
Status *string `json:"status,omitempty"`
UserID *string `json:"user_id,omitempty"`
Agent *string `json:"agent,omitempty"`
Channel *string `json:"channel,omitempty"`
Version *string `json:"version,omitempty"`
OS *string `json:"os,omitempty"`
Arch *string `json:"arch,omitempty"`
ProtocolVersion *string `json:"protocol_version,omitempty"`
Labels map[string]*string `json:"labels,omitempty"`
}
type ListClientsParams ¶ added in v1.8.0
type ListClientsParams struct {
Limit *int `json:"limit,omitempty"`
Filters *ListClientsFilters `json:"filters,omitempty"`
}
type ListClientsResponse ¶ added in v1.8.0
type ListClientsResponse = []ClientProperties
type ListTunnelsFilters ¶ added in v1.2.0
type ListTunnelsFilters struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Status *string `json:"status,omitempty"`
ClientID *string `json:"client_id,omitempty"`
UserID *string `json:"user_id,omitempty"`
Protocol *string `json:"protocol,omitempty"`
Publish *bool `json:"publish,omitempty"`
HTTPVersion *string `json:"http_version,omitempty"`
Labels map[string]*string `json:"labels,omitempty"`
}
type ListTunnelsParams ¶ added in v1.2.0
type ListTunnelsParams struct {
Limit *int `json:"limit,omitempty"`
Filters *ListTunnelsFilters `json:"filters,omitempty"`
}
type ListTunnelsResponse ¶ added in v1.2.0
type ListTunnelsResponse = []TunnelInventory
type PacketListener ¶ added in v1.2.0
type PacketListener interface {
Accept() (net.PacketConn, net.Addr, error)
Close() error
Addr() net.Addr
}
func PacketListenerFromListener ¶ added in v1.2.0
func PacketListenerFromListener(l net.Listener) PacketListener
type PacketMode ¶ added in v1.2.0
type PacketMode int
const ( PacketModeFramed PacketMode = iota PacketModeRaw )
type ServerDetails ¶ added in v1.3.0
type TURNCredentialMode ¶ added in v1.10.0
type TURNCredentialMode string
const ( TURNCredentialModeAPI TURNCredentialMode = "api" TURNCredentialModePAT TURNCredentialMode = "pat" )
type TURNCredentials ¶ added in v1.10.0
type TURNCredentials = controlplane.TURNCredentials
func CreateTURNCredentials ¶ added in v1.10.0
func CreateTURNCredentials(ctx context.Context, opts CreateTURNCredentialsOptions) (*TURNCredentials, error)
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
type Tunnel ¶
type Tunnel interface {
ForwardingAddress() (string, error)
Properties() (TunnelProperties, error)
Close() error
}
type TunnelInventory ¶ added in v1.9.0
type TunnelInventory struct {
TunnelProperties
Status string `json:"status"`
ClientID string `json:"client_id,omitempty"`
}
type TunnelProperties ¶
type TunnelProperties struct {
ID *string `json:"id,omitempty"`
CreationDate *time.Time `json:"creation_date,omitempty"`
Name *string `json:"name,omitempty"`
Type *TunnelType `json:"type,omitempty"`
Publish *bool `json:"publish,omitempty"`
Protocol *Protocol `json:"protocol,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
GeoIP []string `json:"geo_ip,omitempty"`
TrustedIPs []string `json:"trusted_ips,omitempty"`
Host *string `json:"host,omitempty"`
TLSMode *TLSMode `json:"tls_mode,omitempty"`
TLSALPNs []string `json:"tls_alpns,omitempty"`
TLSMinVersion *string `json:"tls_min_version,omitempty"`
TLSCiphers []string `json:"tls_ciphers,omitempty"`
MTLS *bool `json:"mtls,omitempty"`
MTLSCACertPEM *string `json:"mtls_ca_cert_pem,omitempty"`
HTTPVersion *HTTPVersion `json:"http_version,omitempty"`
HTTPUseTLS *bool `json:"http_use_tls,omitempty"`
TokenAuth *bool `json:"token_auth,omitempty"`
RstreamAuth *bool `json:"rstream_auth,omitempty"`
ChallengeMode *bool `json:"challenge_mode,omitempty"`
}
type TunnelType ¶
type TunnelType string
const ( TunnelTypeBytestream TunnelType = "bytestream" TunnelTypeDatagram TunnelType = "datagram" )
func TunnelTypePtr ¶
func TunnelTypePtr(t TunnelType) *TunnelType
type WatchParams ¶ added in v1.8.0
type WatchParams struct {
Clients *ListClientsFilters `json:"clients,omitempty"`
Tunnels *ListTunnelsFilters `json:"tunnels,omitempty"`
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
rstream
command
|
|
|
whoami
command
|
|
|
examples
|
|
|
api-list-tunnels
command
|
|
|
datagram-echo-client
command
|
|
|
datagram-echo-server
command
|
|
|
http-h1-client
command
|
|
|
http-h1-server
command
|
|
|
http-h2c-client
command
|
|
|
http-h2c-server
command
|
|
|
http-h3-client
command
|
|
|
http-h3-server
command
|
|
|
http-tls-client
command
|
|
|
http-tls-server
command
|
|
|
http-ws-client
command
|
|
|
http-ws-server
command
|
|
|
http-wt-client
command
|
|
|
http-wt-server
command
|
|
|
quic-echo-client
command
|
|
|
quic-echo-server
command
|
|
|
stream-echo-client
command
|
|
|
stream-echo-server
command
|
|
|
turn-credentials
command
|
|
Click to show internal directories.
Click to hide internal directories.