Documentation
¶
Index ¶
- Variables
- func BoolPtr(b bool) *bool
- 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 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) 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, handler func(Event) error) error
- func (c *Client) WatchSSE(ctx context.Context, handler func(Event) error) error
- func (c *Client) WatchWS(ctx context.Context, handler func(Event) error) error
- type Config
- type ControlChannel
- type DatagramTunnel
- type Dialer
- type Event
- type HTTPVersion
- type ListTunnelsFilters
- type ListTunnelsParams
- type ListTunnelsResponse
- type PacketListener
- type PacketMode
- type Protocol
- type TLSMode
- type Transport
- type Tunnel
- type TunnelProperties
- type TunnelType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Channel = "dev" Version = "development" OS = runtime.GOOS Arch = runtime.GOARCH )
Functions ¶
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 StrOrUndef ¶
func Uint32ToIPv4 ¶ added in v1.2.0
Types ¶
type BytestreamTunnel ¶
type Client ¶
type Client struct {
ConfigFilePath *string
Transport Dialer
TLSClientConfig *tls.Config
EngineURL *string
Token *string
NoToken *bool
ZeroRTT *bool
}
func (*Client) ListTunnels ¶ added in v1.2.0
func (c *Client) ListTunnels(ctx context.Context, params *ListTunnelsParams) (*ListTunnelsResponse, error)
func (*Client) PacketDial ¶
type ControlChannel ¶
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 ListTunnelsFilters ¶ added in v1.2.0
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 = []TunnelProperties
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 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 TunnelProperties ¶
type TunnelProperties struct {
// Basic tunnel properties
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
CreationDate *time.Time `json:"creation_date,omitempty"`
// Tunnel options
Type *TunnelType `json:"type,omitempty"`
Publish *bool `json:"publish,omitempty"`
Protocol *Protocol `json:"protocol,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Host *string `json:"host,omitempty"`
Path *string `json:"path,omitempty"`
// Security options
GeoIP []string `json:"geo_ip,omitempty"`
TrustedIPs []string `json:"trusted_ips,omitempty"`
Domain *string `json:"domain,omitempty"`
// TLS options
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"`
// HTTP tunnel options (only for HTTP tunnels)
HTTPVersion *HTTPVersion `json:"http_version,omitempty"`
HTTPUseTLS *bool `json:"http_use_tls,omitempty"`
TokenAuth *bool `json:"token_auth,omitempty"`
SSO *bool `json:"sso,omitempty"`
SSOProviders []string `json:"sso_providers,omitempty"`
EmailWhitelist []string `json:"email_whitelist,omitempty"`
EmailBlacklist []string `json:"email_blacklist,omitempty"`
Challenge *bool `json:"challenge,omitempty"`
}
type TunnelType ¶
type TunnelType string
const ( TunnelTypeBytestream TunnelType = "bytestream" TunnelTypeDatagram TunnelType = "datagram" )
func TunnelTypePtr ¶
func TunnelTypePtr(t TunnelType) *TunnelType
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
rstream
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
|
|
Click to show internal directories.
Click to hide internal directories.