workers icon indicating copy to clipboard operation
workers copied to clipboard

Websocket support

Open haorendashu opened this issue 1 year ago • 3 comments

Using package github.com/gorilla/websocket to server websocket connection. When call upgrader.Upgrade(w, r, nil), it return an error:

2024/04/10 21:16:42 failed to upgrade websocket: websocket: response does not implement http.Hijacker

It seems that the response need to implement http.Hijacker interface.

haorendashu avatar Apr 10 '24 15:04 haorendashu

This library is using JS API directly, so it's hard to provide http.Hijacker interface for Conn. But WebSocket support can be implemented using Durable Object, so I want to try another approach (without providing http.Hijacker). Thank you for submitting this issue!

syumai avatar Apr 12 '24 14:04 syumai

This library is using JS API directly, so it's hard to provide http.Hijacker interface for Conn. But WebSocket support can be implemented using Durable Object, so I want to try another approach (without providing http.Hijacker). Thank you for submitting this issue!

Hi @syumai! Have you made any progress with this approach? Been trying to make it work with websocket and Durable Objects but no luck so far. Thanks!

igolaizola avatar Oct 23 '24 15:10 igolaizola