I do it in a header for both HTTP and the WebSocket upgrade requests. You can't set the header for W
I do it in a header for both HTTP and the WebSocket upgrade requests. You can't set the header for WebSockets in the browser but you can add it in the Worker fetch handler when it processes the WebSocket upgrade request. This is my utility for handling both HTTP and WebSocket DO requests:
routeDORequest. If you use it, the DO will automatically get the headers on each request or WebSocket upgrade. You'll still have to pluck them out of the headers and stick them in storage. If you want to see how I do it, look at the source code here.
