Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can a client (web browser) connect direct to Durable object via websocket #45

Open
boygiandi opened this issue Jul 4, 2024 · 1 comment

Comments

@boygiandi
Copy link

How can a client (web browser) connect direct to Durable object via websocket+hono?

@sor4chi
Copy link
Owner

sor4chi commented Jul 4, 2024

Hi, @boygiandi.
Please note that this is not directly related to Hono DO.

Actually, the Durable Objects technology itself is only accessible as a request from inside Cloudflare Workers.

So, if your requirement is to use Hono + WebSockets with Cloudflare Workers, you need to set a Binding from Cloudflare Workers created with Hono to Duralbe Objects and proxy the ws communication.

Here's an image of what it looks like

Client (browser) <-> Cloudflare Workers (you can use Hono here) <-> Durable Objects (you can use Hono DO here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants