How to get the raw request using a web handler?

https://github.com/Effect-TS/effect/tree/main/packages/platform#how-do-i-get-the-raw-request
Im not working with any platform package and using a web handler to get it workin in a cloudflare worker like so:
// Convert the API to a web handler
const webHandler = HttpApiBuilder.toWebHandler(
    Layer.mergeAll(MyApiLive, SwaggerLayer, HttpServer.layerContext),
);

export default {
    async fetch(request: Request) {
        return webHandler.handler(request);
    },
};


Id like to be able to access the raw request in one of my handlers:

.handle("ws", ({request}) => {
         Effect.gen(function* () {
      const req = yield* HttpServerRequest.HttpServerRequest
      const raw = NodeHttpServerRequest.toIncomingMessage(req)
Was this page helpful?