Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 0a9bfea

Browse files
committed
chore(example-raw-websocket-handler-proxy): use correct url and mount registry
1 parent 91a7caa commit 0a9bfea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

examples/raw-websocket-handler-proxy/src/backend/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { createNodeWebSocket } from "@hono/node-ws";
33
import { Hono } from "hono";
44
import { registry } from "./registry.js";
55

6-
const { client } = registry.createServer();
6+
const { client, hono } = registry.createServer({
7+
getUpgradeWebSocket: () => upgradeWebSocket,
8+
});
79

810
const app = new Hono();
911
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });
@@ -45,5 +47,8 @@ app.get(
4547
}),
4648
);
4749

50+
// Mount RivetKit's registry (optional, but required for Studio integration)
51+
app.route("/registry", hono);
52+
4853
const server = serve({ port: 8080, fetch: app.fetch });
4954
injectWebSocket(server);

examples/raw-websocket-handler-proxy/src/frontend/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function App() {
1616
`conn_params.${encodeURIComponent(JSON.stringify({ apiKey: "your-api-key" }))}`
1717
];
1818

19-
const ws = new WebSocket("ws://localhost:8080/registry/actors/chatRoom/ws/", protocols);
19+
const ws = new WebSocket("ws://localhost:8080/registry/actors/raw/websocket/", protocols);
2020

2121
ws.onopen = () => {
2222
setIsConnected(true);

0 commit comments

Comments
 (0)