Browser console (noVNC over WSS)
The console lets your customer use the server's screen and keyboard from your portal. Your backend asks for a one-use ticket; the customer's browser connects with it directly. Your API secret never reaches the browser.
Flow
- The customer, signed in to your portal, opens the console page of a service.
- Your backend checks that this customer owns the service and that the product grants
vps.console. - Your backend calls
POST /api/v1/services/{service_uuid}/console-sessionswith{"origin": "https://portal.example.com"}— the exact Origin of the page that will open the WebSocket. - The answer has
console_path(/console/v1/<ticket>) andexpires_at(≤ 60 s). - Your page connects a noVNC client to
wss://bridge.serverbike.com+console_path, from that Origin, beforeexpires_at. The ticket works once. - To reconnect (network drop, page reload), ask your backend for a new ticket.
Rules
- The Origin must be your registered portal hostname (
https://<hostname>, default port) or an origin ServerBike added for you. Any other Origin is refused (400at issuance, refused handshake at connect). - The WebSocket goes to port 443 of the API hostname. Allow it in your page's Content Security Policy:
connect-src wss://bridge.serverbike.com. - Do not log ticket URLs (in your server logs, analytics, error reporting or browser history tools); treat a
console_pathlike a short-lived password. - A suspended service gets no console (
409 SERVICE_SUSPENDED). An unavailable console answers503. - Sessions have idle and maximum durations; the server may close a session, and a network edge may close an idle WebSocket. Reconnect with a new ticket.
- Copy from the server's screen is not available; pasting is sent as typed keys by the packaged client (up to 2000 characters, US layout).
Minimal page (sketch)
<div id="screen"></div>
<script type="module">
import RFB from '/assets/novnc/core/rfb.js'; // serve noVNC from your own portal
const r = await fetch('/my-portal/console-ticket?service=...', {method: 'POST', credentials: 'same-origin'});
const {console_path} = await r.json(); // your backend called the API (never the browser)
const rfb = new RFB(document.getElementById('screen'), 'wss://bridge.serverbike.com' + console_path);
rfb.scaleViewport = true;
</script>