New — Iris AI drafts your firewall, routing & rate-limit rules. Explore AI features →
Changelog
Apps

WebSockets for hosted apps, and the whole request in the inspector

Backend apps, full-stack backends and WordPress take WebSockets, and the Traffic Inspector shows a hosted app's response, request body and timing.

WebSockets for hosted apps, and the whole request in the inspector

A chat, a live dashboard or a game needs a connection that stays open. Until now, an app you hosted on ngris couldn't take one: a WebSocket had to go through an agent. And in the Traffic Inspector, your hosted app's requests showed no response, and said your app had never received them.

Now your app takes WebSockets on its port like any other request, with nothing to turn on, and the Traffic Inspector shows what it answered. Above is Acme Labs' shop: a cart update with your app's 200 and the time it took, and a chat that has been open for half an hour.

The response of a POST to /api/cart: the app's status 200, its headers and the cart cookie it set
The response your app sent: its status, its headers and cookies, and the body. The request body is there too, on the Request tab.
A WebSocket in the Traffic Inspector: method WS, status 101 from the app, 30 minutes open, 18 KB in and 249 KB out
A WebSocket is one row, marked WS: your app's 101, how long it stayed open, and the bytes both ways.

What changed

  • WebSockets for hosted apps. A backend app, the backend of a full-stack app and a WordPress site take WebSocket connections, with the usual X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host headers. A serverless function answers one request at a time, so it takes none: use a backend app.
  • The limits you already know. Each open WebSocket counts against your plan's Connections per tunnel for the app and Connections per visitor IP, and against the new Open WebSockets per account. One visitor can't take every connection your app has.
  • Billed as it runs. A WebSocket's bytes count toward your monthly data transfer while it is open, not only when it closes. It closes after 12 hours, or when the account is suspended or over its monthly limits.
  • The whole request. A hosted app's requests show the response headers, cookies and body, the request body, the full URL and the request ID. When your app answered, they show its status and the timing: the edge, your app, the transfer.
  • Who answered. A request your app didn't answer says what did: your static app's live deploy, the edge cache, an edge function, or ngris's own page when the app couldn't be reached. It no longer says the origin never received it.

Get started

  1. Open a WebSocket to your app: new WebSocket("wss://<your app's address>/ws"). Your server takes it on its port.
  2. Turn on your WebSocket library's pings, and reconnect when the connection closes.
  3. Open Observability › Traffic Inspector and click one of your app's requests to see its response.
  4. Read the docs: WebSockets.

Read the docs

Ask an AI to summarise this page
Deploy
App hosting Edge functions Domains & certificates
Connect
Secure tunnels API gateway Multi-region edge
Protect
Bot protection & challenge WAF & firewall Edge login
Observe & AI
Monitoring Inspector & replay Iris AI MCP server AI Gateway
Developers
Developer tools Docs ngrok policy converter Blog Changelog
Compare
Ngris vs ngrok Ngris vs Cloudflare Tunnel Ngris vs Vercel Ngris vs Netlify Expose localhost guide
More
Solutions Pricing Enterprise Sign in Get Started Free