Caught an unexpected error
+
+ Error:{' '}
+ {import.meta.env.DEV && 'message' in props.error
+ ? props.error.message
+ : '(Unknown)'}
+
+
+
+
+ )
+}
diff --git a/packages/plugin-rsc/examples/node-stream/src/framework/request.node.ts b/packages/plugin-rsc/examples/node-stream/src/framework/request.node.ts
new file mode 100644
index 000000000..18e0dc261
--- /dev/null
+++ b/packages/plugin-rsc/examples/node-stream/src/framework/request.node.ts
@@ -0,0 +1,54 @@
+import type { IncomingMessage } from 'node:http'
+import { Readable } from 'node:stream'
+import { HEADER_ACTION_ID, URL_POSTFIX } from './request'
+
+type RenderRequest = {
+ isRsc: boolean
+ isAction: boolean
+ actionId?: string
+ url: URL
+}
+
+export function parseRenderRequest(request: IncomingMessage): RenderRequest {
+ const host = request.headers.host ?? 'localhost'
+ const url = new URL(request.url ?? '/', `http://${host}`)
+ const isAction = request.method === 'POST'
+ if (url.pathname.endsWith(URL_POSTFIX)) {
+ url.pathname = url.pathname.slice(0, -URL_POSTFIX.length)
+ const actionId = request.headers[HEADER_ACTION_ID]
+ if (Array.isArray(actionId)) {
+ throw new Error(`Multiple ${HEADER_ACTION_ID} headers`)
+ }
+ if (isAction && !actionId) {
+ throw new Error('Missing action id header for RSC action request')
+ }
+ return { isRsc: true, isAction, actionId, url }
+ }
+ return { isRsc: false, isAction, url }
+}
+
+export async function readRequestBody(
+ request: IncomingMessage,
+): Promise