desktopbridge

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolVersion = "redeven-desktop-placement-h2/1"

	HelloPath           = "/redeven/placement/v1/hello"
	ShutdownRuntimePath = "/redeven/placement/v1/actions/shutdown-runtime"
	BridgeAuthority     = "redeven-placement"
	ErrorCodeHeader     = "X-Redeven-Placement-Error-Code"
)
View Source
const (
	MaxConcurrentStreams      = 64
	MaxHeaderListBytes        = 8 << 10
	MaxControlResponseBytes   = 1 << 20
	StreamReceiveWindowBytes  = 256 << 10
	SessionReceiveWindowBytes = 16 << 20
)
View Source
const (
	ErrorInvalidRequest     = "INVALID_REQUEST"
	ErrorSurfaceUnavailable = "SURFACE_UNAVAILABLE"
	ErrorSurfaceDialFailed  = "SURFACE_DIAL_FAILED"
)

Variables

This section is empty.

Functions

func ProbeSurface added in v0.10.0

func ProbeSurface(ctx context.Context, dial SurfaceDialer, surface StreamSurface) error

Types

type GatewayProtocol added in v0.7.1

type GatewayProtocol struct {
	Available bool `json:"available"`
}

type GatewayService added in v0.10.0

type GatewayService struct {
	StateRoot          string `json:"state_root"`
	ExecutablePath     string `json:"executable_path"`
	ServicePID         int    `json:"service_pid"`
	ManagedBridgeToken string `json:"managed_bridge_token"`
}

type Hello

type Hello struct {
	ProtocolVersion string          `json:"protocol_version"`
	RuntimeVersion  string          `json:"runtime_version"`
	RuntimeCommit   string          `json:"runtime_commit,omitempty"`
	StartedAtUnixMS int64           `json:"started_at_unix_ms,omitempty"`
	LocalUI         HelloLocalUI    `json:"local_ui"`
	RuntimeControl  RuntimeControl  `json:"runtime_control"`
	RuntimeService  any             `json:"runtime_service"`
	GatewayProtocol GatewayProtocol `json:"gateway_protocol,omitempty"`
	GatewayService  *GatewayService `json:"gateway_service,omitempty"`
}

type HelloLocalUI

type HelloLocalUI struct {
	URLs             []string `json:"urls"`
	PasswordRequired bool     `json:"password_required"`
	Available        bool     `json:"available"`
	BasePath         string   `json:"base_path"`
	BridgeToken      string   `json:"bridge_token,omitempty"`
}

type RuntimeControl

type RuntimeControl struct {
	Available       bool   `json:"available"`
	ProtocolVersion string `json:"protocol_version,omitempty"`
	BaseURL         string `json:"base_url,omitempty"`
	Token           string `json:"token,omitempty"`
}

type Server

type Server struct {
	DialSurface SurfaceDialer
	Hello       Hello
	OnShutdown  func()
}

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, in io.Reader, out io.Writer) error

IMPORTANT: The Desktop bridge is a placement transport. It must not become a provider tunnel, published-port shortcut, or host-network fallback.

type StreamSurface

type StreamSurface string
const (
	StreamSurfaceLocalUI         StreamSurface = "local_ui"
	StreamSurfaceRuntimeControl  StreamSurface = "runtime_control"
	StreamSurfaceGatewayProtocol StreamSurface = "gateway_protocol"
)

func SurfaceFromAuthority added in v0.13.0

func SurfaceFromAuthority(authority string) (StreamSurface, bool)

func (StreamSurface) Authority added in v0.13.0

func (surface StreamSurface) Authority() string

type SurfaceDialer

type SurfaceDialer func(context.Context, StreamSurface) (net.Conn, error)

func NewGatewaySurfaceDialer added in v0.10.0

func NewGatewaySurfaceDialer(gatewayURL string, managedGatewayBridgeToken string) SurfaceDialer

func NewTrustedBridgeSurfaceDialer added in v0.10.0

func NewTrustedBridgeSurfaceDialer(localUIBridgeURL string, runtimeControlURL string) (SurfaceDialer, error)

Jump to

Keyboard shortcuts

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