This repository was archived by the owner on Oct 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
examples/raw-websocket-handler-proxy/src Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import { createNodeWebSocket } from "@hono/node-ws";
33import { Hono } from "hono" ;
44import { registry } from "./registry.js" ;
55
6- const { client } = registry . createServer ( ) ;
6+ const { client, hono } = registry . createServer ( {
7+ getUpgradeWebSocket : ( ) => upgradeWebSocket ,
8+ } ) ;
79
810const app = new Hono ( ) ;
911const { 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+
4853const server = serve ( { port : 8080 , fetch : app . fetch } ) ;
4954injectWebSocket ( server ) ;
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments