How to use websockets on workers?
I'm trying to connect openAI realtime to workers, I use nuxt/nitro.
I get this error in the logs:
[ws] Error in open handler: SyntaxError: WebSocket Constructor: The protocol header token is invalid.
1 Reply
This is an example which works locally but fails on production/workers: https://pastecode.io/s/j4oo4jvn
For whomever finds this via search the solution is to use subprotocols: