Skip to content
Back

Realtime API over cloudflare tunnels

  • 0
  • 3
  • Self Hosted
  • Realtime
MrT
18 Feb, 2026, 19:15

Hello. Is it possible to use the realtime subscriptions, when the self-hosted instance is exposed via cloudflare tunnels? There is no additional proxy. I am using latest SDK for next.js and when i try to subscribe to a particular table:

TypeScript
const subString = Channel.tablesdb("<db_id>").table("<table_id>");
const sub = realtime.subscribe(subString, response => {
    console.log(response.payload);
});

seems like it does not receive any updates. The state, when logged to console, is 'pending', and no operations in that table can trigger the sub. I tried setting the

TypeScript
.setEndpointRealtime("wss://myappwriteinstance.com/v1/realtime")

but this did not work either.

TL;DR
The user is seeking assistance with setting up a Realtime API over cloudflare tunnels. They discover a bug related to tablesdb prefix and are advised on how to fix it. They also discuss checking if the ping/pong is working and confirming a required part of the setup. A fix for the bug is merged and expected to be released in version 1.8.2 soon.
MrT
18 Feb, 2026, 19:18

actually i spotted that I did not await the subscribe() but even with that done - still no results

Roelj44
18 Feb, 2026, 19:53

Same issue here.

Below a react component I created to test the realtime connection. What I found is that only the old way of writing subscriptions works (see attached image which show the logs i receive). The legacy subscription does come through. When i test this same setup, but then with an Appwrite cloud client, it does work. So I assume it has something to do with the self-hosting or setup of it. The current way I host Appwrite is though Coolify, in which I started with the default template, and upgraded from 1.7.4. > 1.7.5 > 1.8.0 > 1.8.1. On each updagrade did a migration if necessary, but still no luck.

Would be great if someone could help!

TypeScript
"use client";

import { useEffect } from "react";
import { Channel } from "appwrite";
import { Client, Realtime } from "appwrite";

export function RealtimeTest() {
  useEffect(() => {
    const client = new Client()
      .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!)
      .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID!);

    const realtime = new Realtime(client);

    client.subscribe("rows", (response) => {
      console.log("Legacy row event:", response);
    });

    const startSubscription = async () => {
      try {
        console.log("Subscribing to realtime events...");

        const subscription = await realtime.subscribe(
          Channel.rows(),
          (response) => {
            console.log("New async Realtime event:", response);
          },
        );

        console.log("Subscription created: ", subscription);
      } catch (err) {
        console.error("Realtime subscribe failed:", err);
      }
    };

    startSubscription();
  }, []);
  return <></>;
}
19 Feb, 2026, 00:33

Could you please provide logs from the realtime container? I would want to compare it with mine.

I am writing it from the top of my head now, but I believe it was something like docker logs appwrite-realtime

19 Feb, 2026, 19:18

Sure, I don't know if this is what you want, please let me know.

On the right you can see that i created a row, and the event does come in just via the legacy code. But i'm not seeing the event in the left console, so maybe I'm not understanding exactly what you mean.

It is the Coolify dashboard btw.

21 Feb, 2026, 10:20

Can you check whether the heartbeats (ping/pong) working or not on the console? Cause console also uses realtime

26 Feb, 2026, 08:56

Sure, but how exactly do I do that?

26 Feb, 2026, 09:02

Nvm - I got that. Yes, there is working ping/pong

26 Feb, 2026, 09:03

actually there is a bug regarding the tablesdb prefix

26 Feb, 2026, 09:03

in the realtime

26 Feb, 2026, 09:03

I made the pr -> should be sorted in sometime

1
26 Feb, 2026, 09:05

also you have to listen to rows and not tables here you should add .rows() or .row(rowId) here

26 Feb, 2026, 09:07

Right - thanks. Also is this a required part of the setup .setEndpointRealtime("wss://myappwriteinstance.com/v1/realtime")? Or can I skip that in case my configuration isn't different than default one?

26 Feb, 2026, 09:10

better to add it, since you are using your self hosted instance

26 Feb, 2026, 09:11

I see. So the tablesdb fix we can expect to be published no sooner than in 1.8.2 release? Or is there maybe a way to track its status?

26 Feb, 2026, 09:51

its merged, will be released in sometime(today most prolly) -> will ping

1
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more