Open gmosx opened 4 years ago
Why not just use async-tungstenite
?
Someone in discord was talking about this recently rtyler I think. I don't know their github handle.
It may just be that no one has needed it enough to spend the time, not sure.
I think the right ordering to adding websocket support to Surf is:
window.WebSocket
interface for localghost
surf
for the WASM
targetasync-tungstenite
(or similar) into surf
using the same interfaceThe reason for this ordering is that we've observed for SSE that the browser's API exposes a subset of what the protocol is capable of delivering. So in order for Surf to continue to work on all platforms we should target the lowest common denominator.
One reason to support this natively: it could integrate with connection reuse, to allow sending a request, getting back a response, and then opening a websocket, all on the same connection.
Are there any plans to support
WebSocket
withinSurf
?