<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hibira</title>
    <description>The latest articles on DEV Community by Hibira (@hibira).</description>
    <link>https://dev.to/hibira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4231947%2F30ee80b6-f70c-46c8-8cb5-f8013f2130d0.jpg</url>
      <title>DEV Community: Hibira</title>
      <link>https://dev.to/hibira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hibira"/>
    <language>en</language>
    <item>
      <title>Migrating from Pusher Channels: change the host, keep your code</title>
      <dc:creator>Hibira</dc:creator>
      <pubDate>Fri, 13 Nov 2026 01:23:59 +0000</pubDate>
      <link>https://dev.to/hibira/migrating-from-pusher-channels-change-the-host-keep-your-code-5bl7</link>
      <guid>https://dev.to/hibira/migrating-from-pusher-channels-change-the-host-keep-your-code-5bl7</guid>
      <description>&lt;p&gt;Hibira speaks the Pusher Channels protocol. Your client libraries, server libraries, channel names, events and auth endpoints keep working. What changes is the host they connect to and the credentials they use. This post walks through a migration from start to finish, including how to keep old and new clients served during a gradual cutover. Dual publishing reduces gaps, but it does not guarantee zero missed or duplicate events.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stays the same
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client libraries:&lt;/strong&gt; pusher-js, Laravel Echo, PusherSwift, pusher-java-client and the other Pusher clients.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server libraries:&lt;/strong&gt; the official &lt;code&gt;pusher&lt;/code&gt; packages for Node.js, PHP, Python, Go, Ruby, Java and .NET all take a host option.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Channels and events:&lt;/strong&gt; public, private, presence and encrypted channels, client events, the HTTP API (trigger, batch, channel queries), cache channels, user authentication and watchlists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Webhooks:&lt;/strong&gt; requests carry the same &lt;code&gt;X-Pusher-Key&lt;/code&gt; and &lt;code&gt;X-Pusher-Signature&lt;/code&gt; headers, so your handler verifies them unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list, side by side, is on the &lt;a href="https://hibira.io/migrate" rel="noopener noreferrer"&gt;migration page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvtcooygrvdhuigtb719o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvtcooygrvdhuigtb719o.webp" alt="Only the host and the credentials change; channels, events and auth endpoints stay" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: create an app
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hibira.io/signup" rel="noopener noreferrer"&gt;Sign up&lt;/a&gt;, create an app and copy its app ID, key and secret. On the Free plan, list the domains your site runs on as allowed origins; browsers on other origins are refused.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41oerlni76vjcykdw7i8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41oerlni76vjcykdw7i8.webp" alt="App ID, key and secret on the app page" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: point your server at the new host
&lt;/h2&gt;

&lt;p&gt;Every official server library takes a host. In Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;Pusher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'pusher'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pusher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Pusher&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUSHER_APP_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUSHER_APP_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUSHER_APP_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'ws.hibira.io'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'443'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;useTLS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;pusher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'order-shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Laravel, Broadcasting already reads the host from &lt;code&gt;.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;BROADCAST_CONNECTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;pusher&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;secret&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hibira&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_SCHEME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_CLUSTER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;hkg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check that &lt;code&gt;config/broadcasting.php&lt;/code&gt; passes &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;port&lt;/code&gt;, &lt;code&gt;scheme&lt;/code&gt; and &lt;code&gt;useTLS&lt;/code&gt; into the pusher connection's options. Configs from older Laravel versions sometimes pass only the cluster, which sends traffic to pusher.com.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: point your clients at the new host
&lt;/h2&gt;

&lt;p&gt;pusher-js needs the host, the port and the transports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pusher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Pusher&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'your-app-key'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;cluster&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'hkg'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;wsHost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'ws.hibira.io'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;wsPort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;wssPort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;forceTLS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;enabledTransports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'ws'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wss'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;cluster&lt;/code&gt; value is required by pusher-js but ignored once &lt;code&gt;wsHost&lt;/code&gt; is set. Put your app's Hibira cluster there (&lt;code&gt;hkg&lt;/code&gt; for Hong Kong, shown on the app page), the way you would name a Pusher cluster such as &lt;code&gt;ap1&lt;/code&gt;. &lt;code&gt;enabledTransports&lt;/code&gt; keeps the client on WebSockets instead of falling back to Pusher's HTTP transports. Laravel Echo takes the same options. Your channel names, event names and authorization endpoint don't change.&lt;/p&gt;

&lt;p&gt;Mobile clients are the same idea: PusherSwift and pusher-java-client take a host option. Ship that change in an app release.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: recreate your webhooks
&lt;/h2&gt;

&lt;p&gt;If you use webhooks (channel occupied and vacated, member added and removed, client events, cache misses), add your webhook URL on the app page. Hibira signs requests with your app secret the same way Pusher does.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj2at5kizehus6wc8wltp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj2at5kizehus6wc8wltp.webp" alt="Webhook URLs and the events each one receives, on the app page" width="799" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: switch over without downtime
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What “without downtime” means:&lt;/strong&gt; Dual publishing can keep both old and new clients receiving updates during rollout, but it is not an atomic transaction across providers. One publish may succeed while the other fails; retries can also duplicate events. Give application events stable IDs, use an outbox or retry queue where delivery matters, and have clients refetch authoritative state after reconnecting. Verify that your auth endpoint signs for the correct app secret during the overlap.&lt;/p&gt;

&lt;p&gt;Clients and servers rarely update at the same moment, especially with mobile apps in the stores. The safe order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Publish to both.&lt;/strong&gt; Change your server to send each event to Pusher and to Hibira. Two clients, one call each.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release the client change.&lt;/strong&gt; New clients connect to Hibira; old clients stay on Pusher, and both receive every event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait.&lt;/strong&gt; Watch connections move over on the app page. For mobile apps this can take weeks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop publishing to Pusher&lt;/strong&gt; once old clients are few enough, then remove the Pusher credentials.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Presence channels are the one thing to think about during the overlap: members on Pusher and members on Hibira don't see each other. If presence lists matter, keep the overlap short or show presence only to clients on the new host.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbxif253xy1mhwlaugt4o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbxif253xy1mhwlaugt4o.webp" alt="Switch over without downtime: publish to both until old clients are gone" width="799" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What to check after the move
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Private and presence channels authorize: your auth endpoint signs with the new secret.&lt;/li&gt;
&lt;li&gt;Webhooks arrive and verify.&lt;/li&gt;
&lt;li&gt;The app page's debug console shows your events as they're published.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrqi0k9ynbgk19urnasj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrqi0k9ynbgk19urnasj.webp" alt="The debug console: connections, subscriptions and every published event, live" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you hit something we don't support yet, write to &lt;a href="mailto:support@hibira.io"&gt;support@hibira.io&lt;/a&gt;. For other stacks, the &lt;a href="https://hibira.io/guides" rel="noopener noreferrer"&gt;integration guides&lt;/a&gt; show the same change for 12 libraries.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://hibira.io/blog/migrating-from-pusher?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=crosspost&amp;amp;utm_content=migrating-from-pusher" rel="noopener noreferrer"&gt;Hibira blog&lt;/a&gt;. Hibira is a hosted, Pusher-compatible WebSocket service with servers in Hong Kong; the Free plan needs no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>websocket</category>
      <category>laravel</category>
      <category>javascript</category>
      <category>realtime</category>
    </item>
    <item>
      <title>Why we stopped running our own WebSocket servers</title>
      <dc:creator>Hibira</dc:creator>
      <pubDate>Tue, 10 Nov 2026 21:50:10 +0000</pubDate>
      <link>https://dev.to/hibira/why-we-stopped-running-our-own-websocket-servers-1lhm</link>
      <guid>https://dev.to/hibira/why-we-stopped-running-our-own-websocket-servers-1lhm</guid>
      <description>&lt;p&gt;Before Hibira, we ran our own WebSocket server on past projects: an off-the-shelf open-source PHP server, run as a standalone service on a single node. Realtime was a small part of the system, so as long as it worked, nobody paid it much attention. Then message volume grew, and it started falling behind: the server was busy with the messages it already had, new requests queued up behind them, and latency kept climbing. By the time a message reached the user, it was already out of date. The price had moved, the score had changed, and the "typing…" indicator showed up after the other person had already sent their message.&lt;/p&gt;

&lt;p&gt;This post is what we took away from that: why a realtime server can jam at peak load, what you have to add if you run one yourself, and when handing it to a hosted service is worth it. Looking back, open source wasn't the problem; we had made sure it worked, but never planned for monitoring, scaling and maintenance. Self-hosting can be done well; mature open-source servers exist. What it takes is ongoing work, and that work is what this post is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the jam happens
&lt;/h2&gt;

&lt;p&gt;What a realtime server does looks simple: take an event and send it to every subscribed connection. The trouble is that the work gets multiplied, and as soon as one part slows down, everything behind it waits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnk75uwv1ekru272dfwrj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnk75uwv1ekru272dfwrj.webp" alt="When processing falls behind, every new message queues behind all the old ones" width="799" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Arriving faster than processed: the queue only grows
&lt;/h3&gt;

&lt;p&gt;This is the basic rule of queues: as long as messages arrive faster than the server can process them, the queue keeps growing, and every new message waits for all the ones before it.&lt;/p&gt;

&lt;p&gt;Put some numbers on it. Say the server can write 5,000 messages a second to clients (that counts copies actually sent, not publishes; the next section explains the difference), and during a burst it has 6,000 a second to send for 10 seconds. Those 10 seconds leave 10,000 messages unprocessed. Assuming the burst ends and new messages stop entirely, the server still needs another 2 seconds to clear them, so the last message in the queue goes out 2 seconds late. If normal traffic keeps arriving after the burst, it clears even more slowly.&lt;/p&gt;

&lt;p&gt;On a web page, 2 seconds late is a worse experience. In a realtime feature, a price, position or game state from 2 seconds ago is often simply wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  One event, times every subscriber
&lt;/h3&gt;

&lt;p&gt;Publishing once doesn't mean sending once. On a channel with 2,000 subscribers, every event you publish means 2,000 writes. The real workload is publishes per second × subscribers: 6,000 publishes a second to 2,000 subscribers each would be up to 12 million writes a second. One-to-many cases such as live chat rooms, match scores and operations dashboards are the ones most likely to tip over at the moment the audience grows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Waiting spreads
&lt;/h3&gt;

&lt;p&gt;Once the server is busy, the HTTP requests that publish events slow down too. Your backend waits for them, so its own requests pile up. If timed-out requests are retried automatically, each retry adds more work to a server that is already overloaded. What started as a slow realtime server ends up as a slow system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scaling out was the hard part
&lt;/h3&gt;

&lt;p&gt;Our WebSocket server ran on its own, deployed apart from the application rather than on the same machines. What held us back was scaling. One server can only process so much, and adding a second one means every machine has to share channel subscriptions and presence, so that an event reaches users connected to the other server, with a load balancer in front to spread the connections. Ours was a single node with none of that in place, so there was no way to scale out, and that one server had to take the whole peak. And because there was only one node, every update or restart dropped every WebSocket connection at once, and they all reconnected together.&lt;/p&gt;

&lt;h3&gt;
  
  
  We couldn't see it until it broke
&lt;/h3&gt;

&lt;p&gt;The other problem was visibility. We ran the server ourselves with no dashboards and no alerts: we couldn't see connection counts, message throughput or server load in real time, let alone queue length, message latency or slowed connections, so we never had a clear picture of how the server was really doing. CPU looking fine didn't mean messages were on time. More often than not we only found out once users were affected and it had dragged our main application down with it: publish requests got stuck, the main app waited on them and slowed down too, just as described in "Waiting spreads" above.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other reason: security updates for the runtime
&lt;/h2&gt;

&lt;p&gt;Besides performance, the other reason we stopped running our own was security. We also ran into PHP security vulnerabilities back then and had to chase the patches ourselves. When you run your own servers, every vulnerability in the operating system, the language runtime and the libraries is yours to track, and none can slip.&lt;/p&gt;

&lt;p&gt;A recent example is the pair of critical PHP vulnerabilities known as "PHP2Shell", fixed by the PHP project in October 2026 (&lt;a href="https://cyber.gc.ca/en/alerts-advisories/al26-026-critical-vulnerabilities-impacting-php-cve-2026-109618-cve-2026-109619" rel="noopener noreferrer"&gt;Canadian Centre for Cyber Security advisory AL26-026&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-109618&lt;/strong&gt;: memory corruption while handling out-of-memory (OOM) conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-109619&lt;/strong&gt;: a use-after-free caused by state left over between requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both score 9.2 on CVSS v4.0 and can let an unauthenticated attacker execute code remotely. They affect PHP serving web requests, such as PHP-FPM, Apache mod_php and php-cgi. The fixed versions are 8.2.35, 8.3.36, 8.4.27 and 8.5.12; 8.1 and older no longer get routine official updates.&lt;/p&gt;

&lt;p&gt;To be clear, these two are in PHP serving web requests, so they don't necessarily affect a long-running WebSocket process at all. We cite them as an example of the routine work, not of a WebSocket flaw: whatever language your server is written in, the moment a vulnerability in your stack is public, you have to work out whether you're affected, schedule the upgrade and redeploy, as fast as you can.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you run it yourself, add these
&lt;/h2&gt;

&lt;p&gt;Each of these problems has a fix, but every fix is ongoing work, not a setting you change once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deploy it apart from your application.&lt;/strong&gt; Let the realtime server scale and deploy on its own, so a peak can't take the rest of your app down with it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A bounded queue per connection.&lt;/strong&gt; Writes must not wait on each other. Each connection gets its own queue; when it fills up, that client can't keep up and should be disconnected rather than allowed to slow everyone else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate receiving from sending.&lt;/strong&gt; The publish API shouldn't wait until every subscriber has the message before it answers, or a slow broadcast slows your backend too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal scaling.&lt;/strong&gt; A single server always has a ceiling. Adding machines means every machine has to share channels and presence, with a load balancer in front.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for reconnects and lost messages.&lt;/strong&gt; Clients reconnect after a drop, a deploy or a network change. Reconnects need back-off so they don't all arrive at once, and events published while a client was away are not replayed, so the app has to fetch the current state again after reconnecting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test capacity against peaks.&lt;/strong&gt; A load test at average traffic tells you everything is fine. Test several times your peak, and many clients reconnecting at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor queues and latency, not just CPU.&lt;/strong&gt; The queue can be growing while CPU still looks fine. You need to see how long messages wait and how many connections are dropped for being too slow, and get alerted when it gets worse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Someone on call.&lt;/strong&gt; The peak is usually your most important moment: a ticket sale opening, the last minute of a match, a promotion going live. Someone has to be there when the server has trouble.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep up with security updates.&lt;/strong&gt; When a vulnerability in the operating system, language runtime or libraries goes public, assess it, upgrade and redeploy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazkhirnpr48klm44uljr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazkhirnpr48klm44uljr.webp" alt="The core of the fix: each connection queues on its own, so a slow one only affects itself" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What a hosted service takes on for you
&lt;/h2&gt;

&lt;p&gt;With a hosted realtime service, the provider does the work above. Taking Hibira as the example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Slow clients don't slow anyone else.&lt;/strong&gt; Each connection has its own bounded queue, and writes never wait on each other. A client whose queue fills up or whose writes time out is closed with the Pusher protocol's 4100 error code, which tells pusher-js to wait a moment and reconnect. The disconnect protects everyone else; it doesn't make that device's network faster, so a client that is still slow can be dropped again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your app restores state after a reconnect.&lt;/strong&gt; The Pusher protocol does not replay events a client missed while it was disconnected. On paid plans you can turn on channel history in the app settings, and a reconnecting client can then ask for the events of the last few minutes with &lt;code&gt;pusher:rewind&lt;/code&gt;. For prices, game state or anything else that must be right, treat events as updates and fetch the current state from your backend after connecting; pusher-js and Laravel Echo tell you when the connection is back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can see what happened.&lt;/strong&gt; These disconnects show up on the app's errors card as "Slow client disconnected", with the last 24 hours, on every plan including Free, so you don't have to dig through server logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;We plan the capacity.&lt;/strong&gt; The servers run as a cluster that shares channels and presence, behind a load balancer. It adds servers automatically on CPU, memory and the busiest server's connection count. A new server takes a few minutes to start taking connections, so scaling handles sustained growth, not an instant spike; until then a full server turns new connections away with 4100 and the clients retry on another one. Existing connections stay where they are. That is our side of the infrastructure: your usage is still bounded by your plan's hard limits, so there are no surprises on the bill, and the uptime SLA comes with the Enterprise plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It speaks the Pusher protocol.&lt;/strong&gt; Your existing pusher-js, Laravel Echo and server libraries work as they are, so switching usually needs no rewrite of your app logic: you change the host and credentials, recreate your webhooks, and check the features and limits you rely on. The &lt;a href="https://hibira.io/migrate" rel="noopener noreferrer"&gt;migration guide&lt;/a&gt; lists what is supported and how to switch without downtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;We do the patching.&lt;/strong&gt; Security updates for the WebSocket servers and the runtime under them are ours to handle. You still update your own app, but there is one less thing to watch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The costs should be said plainly too: past the free tier you pay monthly, your events pass through a third party, and you live with the plan's limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  When running your own still makes sense
&lt;/h2&gt;

&lt;p&gt;A hosted service isn't the only answer. Running your own may suit you better when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your traffic is small and steady, without sharp peaks.&lt;/li&gt;
&lt;li&gt;Event contents can't leave your infrastructure.&lt;/li&gt;
&lt;li&gt;You already have an operations team, monitoring and an on-call rotation, so one more long-running service is no burden.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you compare costs, count the whole bill: self-hosting is the servers plus the engineering time spent on monitoring, scaling, patching and on-call; a hosted service is a monthly fee based on usage. With small, steady traffic and someone already looking after it, running your own is often cheaper. When you have to scale for peaks without dedicated ops, the hours usually cost more than the servers.&lt;/p&gt;

&lt;p&gt;Using Laravel? We compared running Reverb yourself with a hosted service in &lt;a href="https://hibira.io/blog/laravel-reverb-or-hosted" rel="noopener noreferrer"&gt;a separate post&lt;/a&gt;. Both speak the Pusher protocol, so changing your mind later is only a configuration change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our takeaway
&lt;/h2&gt;

&lt;p&gt;Mature hosted services already existed, and adopting one might have been simpler. We rebuilt it ourselves anyway: we wanted to really understand how WebSocket and distributed realtime messaging work underneath, and to measure the performance, resource use and running cost of different architectures, which also showed us how services like this are priced.&lt;/p&gt;

&lt;p&gt;We rebuilt realtime messaging as a service that scales out. A load balancer sits in front, each connection has its own bounded queue, and servers are added automatically as load grows, so traffic is spread across more servers instead of one server straining to keep up, with monitoring and alerts on connections, message volume and latency. We used it internally first, then opened it up to everyone else. That is Hibira.&lt;/p&gt;

&lt;p&gt;A self-hosted WebSocket server can run very well. The hard part isn't getting it to run; it's the ongoing work of backpressure, capacity planning, isolation, monitoring and security updates that keeps it on time during the busiest few minutes, which are exactly when users care most and when things are most likely to break. Hibira takes on that ongoing work as a hosted service, so your team can spend its time on the product.&lt;/p&gt;

&lt;p&gt;Hibira's free plan needs no credit card and is enough for development and small apps. Already on Pusher? You usually only change the connection settings, not your app logic; the &lt;a href="https://hibira.io/migrate" rel="noopener noreferrer"&gt;migration guide&lt;/a&gt; has the steps, and we'll share our own migration story in an upcoming post, so stay tuned.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://hibira.io/blog/hosted-vs-self-hosted-realtime?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=crosspost&amp;amp;utm_content=hosted-vs-self-hosted-realtime" rel="noopener noreferrer"&gt;Hibira blog&lt;/a&gt;. Hibira is a hosted, Pusher-compatible WebSocket service with servers in Hong Kong; the Free plan needs no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>websocket</category>
      <category>realtime</category>
      <category>devops</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Laravel Broadcasting: run Reverb yourself, or use a hosted service?</title>
      <dc:creator>Hibira</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:32:44 +0000</pubDate>
      <link>https://dev.to/hibira/laravel-broadcasting-run-reverb-yourself-or-use-a-hosted-service-4bj8</link>
      <guid>https://dev.to/hibira/laravel-broadcasting-run-reverb-yourself-or-use-a-hosted-service-4bj8</guid>
      <description>&lt;p&gt;Laravel Broadcasting gives you two good ways to push events to browsers. You can run &lt;a href="https://laravel.com/docs/reverb" rel="noopener noreferrer"&gt;Laravel Reverb&lt;/a&gt;, the WebSocket server the Laravel team released with Laravel 11, or you can point the &lt;code&gt;pusher&lt;/code&gt; driver at a hosted service such as Pusher or Hibira. Both speak the Pusher protocol, and both work with Laravel Echo and pusher-js. Your events, channels and &lt;code&gt;routes/channels.php&lt;/code&gt; don't change.&lt;/p&gt;

&lt;p&gt;So the question isn't which one your code supports. It's who runs the WebSocket server.&lt;/p&gt;

&lt;h2&gt;
  
  
  What running Reverb asks of you
&lt;/h2&gt;

&lt;p&gt;Reverb is a long-running PHP process built on an event loop. Getting it working locally is one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan install:broadcasting
php artisan reverb:start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Production takes more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A process manager.&lt;/strong&gt; Reverb has to stay up, so it runs under Supervisor or systemd and restarts on deploys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS and a proxy.&lt;/strong&gt; Browsers need &lt;code&gt;wss://&lt;/code&gt;, so Reverb usually sits behind Nginx or a load balancer that terminates TLS and upgrades the connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server limits.&lt;/strong&gt; Each connection is an open file. You'll raise the open-file limit, and past about a thousand connections the Reverb docs recommend the &lt;code&gt;ext-uv&lt;/code&gt; event loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scaling out.&lt;/strong&gt; One Reverb process handles a lot, but more than one server means turning on Reverb's Redis-based scaling and putting a load balancer in front.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watching it.&lt;/strong&gt; Reverb reports to Laravel Pulse. You'll still want alerts for when the process dies or connections spike.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is unusual if you already run your own servers. It's the same work as any other daemon.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a hosted service asks of you
&lt;/h2&gt;

&lt;p&gt;With a hosted Pusher-compatible service you set a few values in &lt;code&gt;.env&lt;/code&gt; and keep using the &lt;code&gt;pusher&lt;/code&gt; driver:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;BROADCAST_CONNECTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;pusher&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_APP_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;secret&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hibira&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;
&lt;span class="na"&gt;PUSHER_SCHEME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41oerlni76vjcykdw7i8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41oerlni76vjcykdw7i8.webp" alt="App ID, key and secret on the app page" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You don't operate a WebSocket process or its TLS yourself, but you still need to choose a plan sized for peak connections and deliveries. In exchange, you pay a monthly fee once you outgrow the free tier, your events pass through a third party, and you live with the plan's limits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmeia9qup7884f8po05ds.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmeia9qup7884f8po05ds.webp" alt="Both paths keep your events and channel routes; only the operations differ" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Reverb on your servers&lt;/th&gt;
&lt;th&gt;Hosted service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Server time and your time&lt;/td&gt;
&lt;td&gt;Free tier, then a monthly plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup&lt;/td&gt;
&lt;td&gt;Process manager, TLS, proxy, limits&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.env&lt;/code&gt; values&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scaling&lt;/td&gt;
&lt;td&gt;Redis scaling and a load balancer&lt;/td&gt;
&lt;td&gt;The provider's job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data path&lt;/td&gt;
&lt;td&gt;Stays on your infrastructure&lt;/td&gt;
&lt;td&gt;Passes through the provider&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extras&lt;/td&gt;
&lt;td&gt;Pulse cards&lt;/td&gt;
&lt;td&gt;Depends on the provider: dashboards, webhooks, push notifications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Migration / lock-in&lt;/td&gt;
&lt;td&gt;You operate the infrastructure&lt;/td&gt;
&lt;td&gt;Compatible SDKs reduce migration work; features and limits may differ&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How to choose
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Run Reverb when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You already operate servers with a process manager and monitoring, and one more daemon is little extra work.&lt;/li&gt;
&lt;li&gt;Events must not leave your infrastructure.&lt;/li&gt;
&lt;li&gt;Your traffic is modest and in one region, close to your servers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use a hosted service when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You deploy to a platform where long-running processes are awkward (serverless, some PaaS plans).&lt;/li&gt;
&lt;li&gt;Nobody on the team wants to be paged for the WebSocket server.&lt;/li&gt;
&lt;li&gt;Your users are far from your servers. A WebSocket server near them shortens every event, even if your app stays where it is.&lt;/li&gt;
&lt;li&gt;You want what sits around the server: a debug console, usage per app, webhooks, push notifications to phones.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  You can change your mind later
&lt;/h2&gt;

&lt;p&gt;The shared protocol reduces migration work, but it does not make providers identical. Check your Laravel version and Echo configuration, channel types (including encrypted and cache channels), client events, webhooks, usage limits and peak concurrent connections before switching. Hosted removes server operations from your team; choosing an adequate plan is still capacity planning.&lt;/p&gt;

&lt;p&gt;Because both speak the same protocol, moving between them is configuration, not code. Going from Reverb to a hosted service means switching &lt;code&gt;BROADCAST_CONNECTION&lt;/code&gt; to &lt;code&gt;pusher&lt;/code&gt;, setting the &lt;code&gt;PUSHER_*&lt;/code&gt; values, and changing Echo's &lt;code&gt;broadcaster&lt;/code&gt; from &lt;code&gt;'reverb'&lt;/code&gt; to &lt;code&gt;'pusher'&lt;/code&gt; with the same host options. Going the other way is the reverse.&lt;/p&gt;

&lt;p&gt;Many teams start hosted to ship quickly and move to Reverb once traffic is predictable, or start on Reverb and move to hosted when the ops work stops being worth it. Either path is fine.&lt;/p&gt;

&lt;p&gt;If you choose hosted, the &lt;a href="https://hibira.io/guides/laravel" rel="noopener noreferrer"&gt;Laravel guide&lt;/a&gt; has the full setup for Hibira, and the free plan covers development and small apps.&lt;/p&gt;

&lt;p&gt;Comparing more options than Reverb? &lt;a href="https://hibira.io/topics/pusher-alternatives" rel="noopener noreferrer"&gt;Pusher alternatives: hosted and self-hosted options compared&lt;/a&gt; covers Ably, PubNub, Soketi, Socket.IO, Centrifugo, Supabase and Firebase side by side.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://hibira.io/blog/laravel-reverb-or-hosted?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=crosspost&amp;amp;utm_content=laravel-reverb-or-hosted" rel="noopener noreferrer"&gt;Hibira blog&lt;/a&gt;. Hibira is a hosted, Pusher-compatible WebSocket service with servers in Hong Kong; the Free plan needs no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>websocket</category>
      <category>realtime</category>
    </item>
    <item>
      <title>Realtime in Asia: where your WebSocket server is matters</title>
      <dc:creator>Hibira</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:32:41 +0000</pubDate>
      <link>https://dev.to/hibira/realtime-in-asia-where-your-websocket-server-is-matters-54m4</link>
      <guid>https://dev.to/hibira/realtime-in-asia-where-your-websocket-server-is-matters-54m4</guid>
      <description>&lt;p&gt;A chat message, a price tick or a "someone is typing" indicator feels instant when it arrives within about a tenth of a second. Most of that budget goes to the network, and most of the network time is set by one thing you choose: where the WebSocket server is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distance sets the floor
&lt;/h2&gt;

&lt;p&gt;Light in optical fibre covers about 200 km per millisecond, roughly two-thirds of its speed in a vacuum. A round trip to a server 1,000 km away therefore takes at least 10 ms, before any routing, queuing or processing. Real cables don't follow the great circle and real routers add delay, so measured round trips are often two to four times this floor: we measured about 30 ms from Hong Kong to Taipei, against a floor of 8 ms.&lt;/p&gt;

&lt;p&gt;Here is the floor from Hong Kong, where Hibira runs today (AWS ap-east-1), to cities across the region:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;From Hong Kong to&lt;/th&gt;
&lt;th&gt;Great-circle distance&lt;/th&gt;
&lt;th&gt;Minimum round trip&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Taipei&lt;/td&gt;
&lt;td&gt;810 km&lt;/td&gt;
&lt;td&gt;8 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Manila&lt;/td&gt;
&lt;td&gt;1,120 km&lt;/td&gt;
&lt;td&gt;11 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bangkok&lt;/td&gt;
&lt;td&gt;1,730 km&lt;/td&gt;
&lt;td&gt;17 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seoul&lt;/td&gt;
&lt;td&gt;2,090 km&lt;/td&gt;
&lt;td&gt;21 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Singapore&lt;/td&gt;
&lt;td&gt;2,590 km&lt;/td&gt;
&lt;td&gt;26 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tokyo&lt;/td&gt;
&lt;td&gt;2,880 km&lt;/td&gt;
&lt;td&gt;29 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jakarta&lt;/td&gt;
&lt;td&gt;3,270 km&lt;/td&gt;
&lt;td&gt;33 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ashburn, Virginia (US East)&lt;/td&gt;
&lt;td&gt;13,090 km&lt;/td&gt;
&lt;td&gt;131 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are physics, not benchmarks: no network can beat them, and yours will be slower. The last row is there for scale. Many US services run their realtime infrastructure in US East; Pusher's default cluster, &lt;code&gt;mt1&lt;/code&gt;, is there too. Pusher does offer clusters in Asia, so if you're on Pusher, check which cluster your app was created in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl10mvcuy13895liiyyto.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl10mvcuy13895liiyyto.webp" alt="Minimum round trip from Hong Kong, set by the speed of light in fibre" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters more for realtime than for web pages
&lt;/h2&gt;

&lt;p&gt;A web page pays the round trip a few times while it loads. A realtime feature pays it on every interaction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Typing indicators and cursors&lt;/strong&gt; send client events many times a second; a slow round trip makes them lag behind the user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chat&lt;/strong&gt; goes from one user to your server, to the WebSocket service, and out to everyone else. Every leg adds its distance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Presence&lt;/strong&gt; (who's online) updates when members join and leave; slow updates show people as online after they've left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reconnects&lt;/strong&gt; after a phone switches networks cost a TLS handshake plus subscriptions, several round trips in a row.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Count every leg
&lt;/h2&gt;

&lt;p&gt;When your backend publishes an event, it travels:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;from the user's action to your backend,&lt;/li&gt;
&lt;li&gt;from your backend to the WebSocket service's HTTP API,&lt;/li&gt;
&lt;li&gt;from the WebSocket service to every subscribed client.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Legs 1 and 3 depend on where your users are. Leg 2 depends on where your backend is. A backend in Tokyo publishing through a WebSocket service in Virginia crosses the Pacific twice for an event between two users in Taipei. Put the WebSocket service near your users, and if you can, put your backend near it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1vfzhdn6xffmtyz6ka1l.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1vfzhdn6xffmtyz6ka1l.webp" alt="Every event pays three legs; legs ① and ③ depend on where your users are" width="799" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure it yourself
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What this test measures:&lt;/strong&gt; &lt;code&gt;pusher:ping&lt;/code&gt;/&lt;code&gt;pusher:pong&lt;/code&gt; measures an already-established WebSocket round trip to the realtime endpoint, not publish-to-subscriber latency or connection setup time. It excludes your backend, event fan-out and browser rendering. Compare multiple runs from representative networks (including mobile), and track the median and p95; DNS, TLS, routing and congestion can change the result.&lt;/p&gt;

&lt;p&gt;Tables are a starting point; your users' networks are what count. The Pusher protocol has a ping message that the server answers immediately, so you can time the round trip without publishing anything. Save this as &lt;code&gt;ping.mjs&lt;/code&gt; and run it with Node.js 22 or newer (which has &lt;code&gt;WebSocket&lt;/code&gt; built in):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// node ping.mjs YOUR_APP_KEY [host]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'ws.hibira.io'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ws&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebSocket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`wss://${host}/app/${key}?protocol=7&amp;amp;client=js&amp;amp;version=8.4.0`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ping&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;sent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'pusher:ping'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;onmessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'pusher:pong'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'pusher:connection_established'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'pusher:pong'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ping&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`best ${times[0].toFixed(1)} ms, median ${((times[9] + times[10]) / 2).toFixed(1)} ms`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it from where your users are: a cloud server in each country you serve, or a colleague's laptop on a home connection. The median is the number to compare; the best shows how close the route gets to the floor. Mobile networks add their own delay on top, so test on a phone hotspot too.&lt;/p&gt;

&lt;p&gt;For a view from real users, time how long pusher-js takes from &lt;code&gt;connecting&lt;/code&gt; to &lt;code&gt;connected&lt;/code&gt; and send it to your analytics with the user's country.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we're doing about it
&lt;/h2&gt;

&lt;p&gt;Hibira runs in Hong Kong today because it sits near the middle of East and Southeast Asia. Tokyo is the next region we're preparing, then Singapore. Apps will stay pinned to one region, so you'll pick the one closest to most of your users.&lt;/p&gt;

&lt;p&gt;If you'd like to see the numbers for your own users before you switch, the &lt;a href="https://hibira.io/pricing" rel="noopener noreferrer"&gt;free plan&lt;/a&gt; is enough to run the script above against your own app.&lt;/p&gt;

&lt;p&gt;Still choosing a provider? &lt;a href="https://hibira.io/topics/pusher-alternatives" rel="noopener noreferrer"&gt;Pusher alternatives: hosted and self-hosted options compared&lt;/a&gt; compares the hosted and self-hosted options: who runs the server, how each is priced and which keep pusher-js working.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://hibira.io/blog/realtime-latency-in-asia?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=crosspost&amp;amp;utm_content=realtime-latency-in-asia" rel="noopener noreferrer"&gt;Hibira blog&lt;/a&gt;. Hibira is a hosted, Pusher-compatible WebSocket service with servers in Hong Kong; the Free plan needs no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>websocket</category>
      <category>realtime</category>
      <category>performance</category>
      <category>networking</category>
    </item>
    <item>
      <title>Add realtime WebSockets with Claude Code in ten minutes</title>
      <dc:creator>Hibira</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:22:16 +0000</pubDate>
      <link>https://dev.to/hibira/add-realtime-websockets-with-claude-code-in-ten-minutes-3cod</link>
      <guid>https://dev.to/hibira/add-realtime-websockets-with-claude-code-in-ten-minutes-3cod</guid>
      <description>&lt;p&gt;Adding realtime to an app is mostly plumbing: create credentials, put them in the right env file, configure a client library, authorize private channels, and then check that an event actually arrives. That's exactly the kind of work an AI coding agent does well, as long as it can reach the service. The Hibira MCP server gives it that reach.&lt;/p&gt;

&lt;p&gt;This post uses Claude Code. Cursor, VS Code, Claude and ChatGPT work the same way; the &lt;a href="https://hibira.io/mcp-server" rel="noopener noreferrer"&gt;MCP server page&lt;/a&gt; has the setup for each.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the agent can do
&lt;/h2&gt;

&lt;p&gt;Through the &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt;, Hibira offers nine tools. The agent can read your plan and apps, create and update apps, read usage, publish a test event, watch the debug console, and fetch the integration guide for your framework with your app's ID and key filled in. It can't delete apps or rotate secrets, and it never sees an existing app's secret.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: add the server
&lt;/h2&gt;

&lt;p&gt;You need a Hibira account; the &lt;a href="https://hibira.io/signup" rel="noopener noreferrer"&gt;free plan&lt;/a&gt; is enough. In your project folder, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http hibira https://hibira.io/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time Claude Code uses the server, it opens a Hibira page in your browser. Sign in, choose &lt;strong&gt;read only&lt;/strong&gt; or &lt;strong&gt;read and write&lt;/strong&gt;, and approve. If it doesn't open on its own, run &lt;code&gt;/mcp&lt;/code&gt; in Claude Code and choose to authenticate the hibira server. Setting up a new app needs write access.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmsyo2az0cxjo7go64btf.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmsyo2az0cxjo7go64btf.webp" alt="The approval page: choose read only or read and write" width="800" height="1105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: ask for what you want
&lt;/h2&gt;

&lt;p&gt;Be specific about your stack and where you'll run it. For a Laravel app with a Vite front end:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add Hibira realtime to this Laravel app. Create an app called "shop-dev" that allows &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;, put the keys in .env, set up Laravel Echo, and broadcast OrderShipped on a private orders channel.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What happens next is the agent's own plan, but it usually goes like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;get_account&lt;/strong&gt; to see the plan and the WebSocket host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;create_app&lt;/strong&gt; with the name and allowed origin. The secret comes back once, and the tool tells the agent to write it straight into your git-ignored &lt;code&gt;.env&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;get_integration_guide&lt;/strong&gt; for &lt;code&gt;laravel&lt;/code&gt;, which returns the Echo configuration, the &lt;code&gt;.env&lt;/code&gt; keys and the steps for private channels, with your values filled in.&lt;/li&gt;
&lt;li&gt;Edits to &lt;code&gt;.env&lt;/code&gt;, &lt;code&gt;config/broadcasting.php&lt;/code&gt;, &lt;code&gt;resources/js/echo.js&lt;/code&gt; and &lt;code&gt;routes/channels.php&lt;/code&gt;, and a new broadcast event.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Review the diff as you would any other change. The edits are ordinary Laravel; nothing in your code depends on the agent afterwards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsra2guywhk1ep5p2rm50.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsra2guywhk1ep5p2rm50.webp" alt="What the agent usually does with one request" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: prove an event arrives
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Publishing is not the same as delivery.&lt;/strong&gt; Seeing an event in &lt;code&gt;watch_debug_events&lt;/code&gt; confirms that Hibira observed the publish or subscription, but it does not prove that a specific browser received and handled the event. Verify the client-side handler with a real subscriber and, for important state, confirm it again through your application's API.&lt;/p&gt;

&lt;p&gt;This is where the debug console earns its keep. Ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Open the app in the browser, then send a test OrderShipped event to private-orders.1 and tell me whether a subscriber received it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent calls &lt;strong&gt;send_test_event&lt;/strong&gt;, which publishes like your server would, and &lt;strong&gt;watch_debug_events&lt;/strong&gt;, which listens to the app's debug console for up to 30 seconds and reports connections, subscriptions and messages. If nothing was subscribed, it can see that too, which usually points at the auth endpoint or the allowed origins.&lt;/p&gt;

&lt;p&gt;On the Free plan the debug console shows connections, subscriptions and published messages; paid plans add client events, webhooks and errors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrqi0k9ynbgk19urnasj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrqi0k9ynbgk19urnasj.webp" alt="The debug console: connections, subscriptions and every published event, live" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Day-to-day questions
&lt;/h2&gt;

&lt;p&gt;Once connected, the server is useful beyond setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"How close are my apps to their daily message limit?" uses &lt;strong&gt;get_usage&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;"Why are browsers on staging.example.com refused?" uses &lt;strong&gt;get_app&lt;/strong&gt; to read the allowed origins, and &lt;strong&gt;update_app&lt;/strong&gt; to fix them if you agree.&lt;/li&gt;
&lt;li&gt;"Turn on client events for shop-dev so typing indicators work" is one &lt;strong&gt;update_app&lt;/strong&gt; call.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keeping it safe
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Understand what the agent can see.&lt;/strong&gt; &lt;code&gt;create_app&lt;/code&gt; returns a &lt;em&gt;new&lt;/em&gt; app secret once to the connected agent so that it can write your local configuration; existing secrets are not returned by read tools. That one-time exposure is still access to a credential: use a trusted agent, review its changes, keep secrets out of browser bundles and commits, give the minimum necessary scope, and revoke an agent token when it is no longer needed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read only when you can.&lt;/strong&gt; Grant read and write while you set things up, and read only for everyday questions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tokens for agents without a browser.&lt;/strong&gt; CI jobs and remote agents can use a personal access token instead of signing in. Make one on the AI agents page, limit it to one app, and give it an expiry date:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx3mc2yreqlgjjo84b3uh.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx3mc2yreqlgjjo84b3uh.webp" alt="The AI agents page lists every connected agent and token; revoke any of them at once" width="800" height="172"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http hibira https://hibira.io/mcp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer hkb_pat_..."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Revoke at any time.&lt;/strong&gt; The AI agents page lists every connected agent and token; revoking one takes effect immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test events are real messages.&lt;/strong&gt; They count toward your plan's daily limit like any other publish, and the server allows a few per second per account.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Sign up for the &lt;a href="https://hibira.io/signup" rel="noopener noreferrer"&gt;free plan&lt;/a&gt;, add the server, and ask your agent to wire up the framework you use. If it gets stuck, the &lt;a href="https://hibira.io/guides" rel="noopener noreferrer"&gt;integration guides&lt;/a&gt; show the same setup by hand.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://hibira.io/blog/websockets-with-claude-code-mcp?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=crosspost&amp;amp;utm_content=websockets-with-claude-code-mcp" rel="noopener noreferrer"&gt;Hibira blog&lt;/a&gt;. Hibira is a hosted, Pusher-compatible WebSocket service with servers in Hong Kong; the Free plan needs no card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>websocket</category>
      <category>claude</category>
      <category>mcp</category>
      <category>realtime</category>
    </item>
  </channel>
</rss>
