8 Replies
should it not have the "upgrade" header
The way websockets work is by first sending a http GET request to the provided endpoint, which can then be upgraded by the server if the
upgrade: websocket
header is sent - along with some other websocket-related headersso how might i handle that on the server side?
not asking for code just a description if possible
here's an example for a worker: https://developers.cloudflare.com/workers/examples/websockets/
Using the WebSockets API · Cloudflare Workers docs
WebSockets allow you to communicate in real time with your Cloudflare Workers serverless functions. In this guide, you will learn the basics of …
well in a worker, you need to tell the runtime to create a websocket connection, terminate one side within the runtime and send back the other one to the client
actually i think i might need some code
im a bit lost
take a look at the tutorial I linked above, it has a complete example
yeah i tried implementing that but it didnt like it
it says that it has an invalid upgrade header
the upgrade header is just websocket though
@PurpleBlob ?
thank you