Session Host Service

The Session Host (started as a backend with webstream.exe -backend) is the private application server — the unit of compute that scales with concurrent sessions. It manages a pool of Windows RDP sessions, launches a Streamer inside each one, and registers itself with the Gateway so traffic can be routed to it.

Function

Ports and endpoints

ListenerPortPurpose
HTTPgateway.backend.advertisedUrl port (default 9005)Health checks, /getConnection, static web client. Port 9005 avoids conflicts: Gateway = 9000, Streamers = 9010/9020/…

In standalone Session Manager mode (-sm, without a gateway) the service also opens a /control WebSocket on basePortNumber (9000) and HTTP on 9001. Production deployments use -backend, where the gateway proxies WebSockets directly to streamers instead.

Message contracts

Outbound — to the Gateway

EndpointMethodFrequencyPayload
/gateway/registerPOSTStartup (after a local /health self-check; retried every 30 s, up to 10 times){ serverUrl, maxSessions, instanceType, ec2InstanceId, tags[], capabilities[], version }
/gateway/heartbeatPOSTEvery 10 s (config heartbeatInterval){ serverUrl, status, activeSessions, maxSessions, instanceType, tags[], cpuUsage, memoryUsage, timestamp }
/gateway/unregisterPOSTShutdown{ serverUrl }

Inbound — from the Gateway

EndpointMethodFrequencyPurpose / payload
/healthGETEvery 1–10 s (gateway health monitor)Returns { status, timestamp, sessions: { total, active, available }, uptime }.
/getConnectionGETPer workspace launch / reconnectRequires X-Session-ID; optional ?width=&height=. Allocates a pool session and returns the streamer connection details. Workspace context arrives in the injected X-Workspace-*, X-App-*, and X-Policy-JSON headers.
Static pathsGETPer page loadWeb client assets from serverHttpPath.

Local — Session Manager ↔ Streamer (WebSocket text protocol)

MessageDirectionWhen
REQUEST_SESSION_INFO:{username}Streamer → Session ManagerStreamer startup inside a new RDP session.
SESSION_INFO:{sessionUuid}|{commandLineParams}Session Manager → StreamerReply carrying the session identity and launch parameters.
FILE_UPLOAD_COMPLETE:{dialogGuid}|{filePath}Session Manager → StreamerNotifies a waiting headless file dialog that an upload has landed.

Configuration

PropertyPurpose
gateway.backend.gatewayUrlThe gateway to register with (HTTPS; the gateway terminates SSL).
gateway.backend.advertisedUrlThis host's own URL as the gateway should reach it (HTTP, private network, default port 9005).
gateway.backend.heartbeatIntervalHeartbeat period in seconds (default 10).
gateway.backend.maxSessionsSession capacity advertised to the gateway's load balancer.
webstreamSettings.serverMaxSessionCountSize of the local RDP session pool.
webstreamSettings.serverSessionUsername / serverSessionPwdBase pool account credentials (accounts webs01… derive from these).
webstreamSettings.basePortNumberBase for the per-session streamer port formula (base + userNumber × 10).
webstreamSettings.serverHttpPathRoot of the static web client (httpdocs).
-tags gpu,autocad (command line)Capability tags advertised at registration, used for tag-aware workspace placement.
filesystemRestrictions, profileCleanupSession hygiene applied at pool-account recycle: NTFS DENY ACLs, registry restore, profile purge.

Aligned settings on peer services