[{"data":1,"prerenderedAt":453},["ShallowReactive",2],{"navigation":3,"-utils-proxy":189,"-utils-proxy-surround":448},[4,91,138,166,173],{"title":5,"path":6,"stem":7,"children":8,"icon":90},"Guide","/guide","1.guide/0.index",[9,12,53,69],{"title":10,"path":6,"stem":7,"icon":11},"Getting Started","pixel:play",{"title":5,"icon":13,"path":14,"stem":15,"children":16,"page":52},"ph:book-open-duotone","/guide/basics","1.guide/1.basics",[17,22,27,32,37,42,47],{"title":18,"path":19,"stem":20,"icon":21},"Request Lifecycle","/guide/basics/lifecycle","1.guide/1.basics/1.lifecycle","icon-park-outline:handle-round",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/guide/basics/routing","1.guide/1.basics/2.routing","solar:routing-bold",{"title":28,"path":29,"stem":30,"icon":31},"Middleware","/guide/basics/middleware","1.guide/1.basics/3.middleware","mdi:middleware-outline",{"title":33,"path":34,"stem":35,"icon":36},"Event Handlers","/guide/basics/handler","1.guide/1.basics/4.handler","mdi:function",{"title":38,"path":39,"stem":40,"icon":41},"Sending Response","/guide/basics/response","1.guide/1.basics/5.response","tabler:json",{"title":43,"path":44,"stem":45,"icon":46},"Error Handling","/guide/basics/error","1.guide/1.basics/6.error","tabler:error-404",{"title":48,"path":49,"stem":50,"icon":51},"Nested Apps","/guide/basics/nested-apps","1.guide/1.basics/7.nested-apps","material-symbols-light:layers-outline",false,{"title":54,"icon":55,"path":56,"stem":57,"children":58,"page":52},"API","material-symbols-light:api-rounded","/guide/api","1.guide/900.api",[59,64],{"title":60,"path":61,"stem":62,"icon":63},"H3","/guide/api/h3","1.guide/900.api/1.h3","material-symbols:bolt-rounded",{"title":65,"path":66,"stem":67,"icon":68},"H3Event","/guide/api/h3event","1.guide/900.api/2.h3event","material-symbols:data-object-rounded",{"title":70,"icon":71,"path":72,"stem":73,"children":74,"page":52},"Advanced","hugeicons:more-01","/guide/advanced","1.guide/901.advanced",[75,80,85],{"title":76,"path":77,"stem":78,"icon":79},"Plugins","/guide/advanced/plugins","1.guide/901.advanced/1.plugins","clarity:plugin-line",{"title":81,"path":82,"stem":83,"icon":84},"WebSockets","/guide/advanced/websocket","1.guide/901.advanced/2.websocket","hugeicons:live-streaming-02",{"title":86,"path":87,"stem":88,"icon":89},"Nightly Builds","/guide/advanced/nightly","1.guide/901.advanced/9.nightly","game-icons:barn-owl","i-ph:book-open-duotone",{"title":92,"path":93,"stem":94,"children":95,"icon":97},"Utils","/utils","2.utils/0.index",[96,98,103,108,113,118,123,128,133],{"title":92,"path":93,"stem":94,"icon":97},"ph:function-bold",{"title":99,"path":100,"stem":101,"icon":102},"Request","/utils/request","2.utils/1.request","material-symbols-light:input",{"title":104,"path":105,"stem":106,"icon":107},"Response","/utils/response","2.utils/2.response","material-symbols-light:output",{"title":109,"path":110,"stem":111,"icon":112},"Cookie","/utils/cookie","2.utils/3.cookie","material-symbols:cookie-outline",{"title":114,"path":115,"stem":116,"icon":117},"Security","/utils/security","2.utils/4.security","wpf:key-security",{"title":119,"path":120,"stem":121,"icon":122},"Proxy","/utils/proxy","2.utils/5.proxy","arcticons:super-proxy",{"title":124,"path":125,"stem":126,"icon":127},"MCP","/utils/mcp","2.utils/6.mcp","material-symbols:swap-calls",{"title":129,"path":130,"stem":131,"icon":132},"More utils","/utils/more","2.utils/9.more","mingcute:plus-line",{"title":134,"path":135,"stem":136,"icon":137},"Community","/utils/community","2.utils/99.community","lets-icons:external",{"title":139,"path":140,"stem":141,"children":142,"icon":144},"Examples","/examples","4.examples/0.index",[143,145,150,154,158,162],{"title":139,"path":140,"stem":141,"icon":144},"ph:code",{"title":146,"path":147,"stem":148,"icon":149},"Cookies","/examples/handle-cookie","4.examples/handle-cookie","ph:arrow-right",{"title":151,"path":152,"stem":153,"icon":149},"Sessions","/examples/handle-session","4.examples/handle-session",{"title":155,"path":156,"stem":157,"icon":149},"Static Assets","/examples/serve-static-assets","4.examples/serve-static-assets",{"title":159,"path":160,"stem":161,"icon":149},"Stream Response","/examples/stream-response","4.examples/stream-response",{"title":163,"path":164,"stem":165,"icon":149},"Validate Data","/examples/validate-data","4.examples/validate-data",{"title":167,"path":168,"stem":169,"children":170,"icon":172},"Migration","/migration","5.migration/0.index",[171],{"title":167,"path":168,"stem":169,"icon":172},"icons8:up-round",{"title":174,"path":175,"stem":176,"children":177},"Blog","/blog","99.blog",[178,181,185],{"title":174,"path":175,"stem":179,"icon":180},"99.blog/index","i-lucide-file-text",{"title":182,"path":183,"stem":184,"icon":180},"H3 1.8 - Towards the Edge of the Web","/blog/v1.8","99.blog/1.v1.8",{"title":186,"path":187,"stem":188,"icon":180},"H3 v2 beta","/blog/v2-beta","99.blog/2.v2-beta",{"id":190,"title":119,"body":191,"description":441,"extension":442,"meta":443,"navigation":445,"path":120,"seo":446,"stem":121,"__hash__":447},"content/2.utils/5.proxy.md",{"type":192,"value":193,"toc":435,"icon":122},"minimark",[194,202,206,221,231,237,240,246,249,259,266,272,275,285,296,307,312,431],[195,196,198],"h3",{"id":197},"fetchwitheventevent-url-init",[199,200,201],"code",{},"fetchWithEvent(event, url, init?)",[203,204,205],"p",{},"Make a fetch request with the event's context and headers.",[203,207,208,209,212,213,216,217,220],{},"If the ",[199,210,211],{},"url"," starts with ",[199,214,215],{},"/",", the request is dispatched internally via ",[199,218,219],{},"event.app.fetch()"," (sub-request) and never leaves the process.",[203,222,223,227,228,230],{},[224,225,226],"strong",{},"Security:"," Never pass unsanitized user input as the ",[199,229,211],{},". Callers are responsible for validating and restricting the URL.",[195,232,234],{"id":233},"getproxyrequestheadersevent",[199,235,236],{},"getProxyRequestHeaders(event)",[203,238,239],{},"Get the request headers object without headers known to cause issues when proxying.",[195,241,243],{"id":242},"proxyevent-target-opts",[199,244,245],{},"proxy(event, target, opts)",[203,247,248],{},"Make a proxy request to a target URL and send the response back to the client.",[203,250,208,251,212,254,216,256,258],{},[199,252,253],{},"target",[199,255,215],{},[199,257,219],{}," (sub-request) and never leaves the process. This bypasses any external security layer (reverse proxy auth, IP allowlisting, mTLS).",[203,260,261,227,263,265],{},[224,262,226],{},[199,264,253],{},". Callers are responsible for validating and restricting the target URL (e.g. allowlisting hosts, blocking internal paths, enforcing protocol).",[195,267,269],{"id":268},"proxyrequestevent-target-opts",[199,270,271],{},"proxyRequest(event, target, opts)",[203,273,274],{},"Proxy the incoming request to a target URL.",[203,276,208,277,212,279,281,282,284],{},[199,278,253],{},[199,280,215],{},", the request is handled internally by the app router via ",[199,283,219],{}," instead of making an external HTTP request.",[203,286,287,288,291,292,295],{},"The request body is streamed to the target without buffering. Per the Fetch standard, a request body can only be consumed once, so reading it beforehand (e.g. via ",[199,289,290],{},"readBody()",", ",[199,293,294],{},"readFormData()",", or body-reading middleware) locks the stream and proxying fails. If you need to inspect the body and still proxy it, read from a clone and leave the original event untouched.",[203,297,298,227,300,302,303,306],{},[224,299,226],{},[199,301,253],{},". Callers are responsible for validating and restricting the target URL (e.g. allowlisting hosts, blocking internal paths, enforcing protocol). Consider using ",[199,304,305],{},"bodyLimit()"," middleware to prevent large request bodies from consuming excessive resources when proxying untrusted input.",[203,308,309],{},[224,310,311],{},"Example:",[313,314,319],"pre",{"className":315,"code":316,"language":317,"meta":318,"style":318},"language-ts shiki shiki-themes github-light github-dark github-dark","app.all(\"/proxy\", async (event) => {\n  const body = await event.req.clone().json(); // read from the clone\n  // ...inspect body...\n  return proxyRequest(event, \"/target\"); // original stream still intact\n});\n","ts","",[199,320,321,363,398,404,425],{"__ignoreMap":318},[322,323,326,330,334,337,341,343,347,350,354,357,360],"span",{"class":324,"line":325},"line",1,[322,327,329],{"class":328},"slsVL","app.",[322,331,333],{"class":332},"shcOC","all",[322,335,336],{"class":328},"(",[322,338,340],{"class":339},"sfrk1","\"/proxy\"",[322,342,291],{"class":328},[322,344,346],{"class":345},"so5gQ","async",[322,348,349],{"class":328}," (",[322,351,353],{"class":352},"sQHwn","event",[322,355,356],{"class":328},") ",[322,358,359],{"class":345},"=>",[322,361,362],{"class":328}," {\n",[322,364,366,369,373,376,379,382,385,388,391,394],{"class":324,"line":365},2,[322,367,368],{"class":345},"  const",[322,370,372],{"class":371},"suiK_"," body",[322,374,375],{"class":345}," =",[322,377,378],{"class":345}," await",[322,380,381],{"class":328}," event.req.",[322,383,384],{"class":332},"clone",[322,386,387],{"class":328},"().",[322,389,390],{"class":332},"json",[322,392,393],{"class":328},"(); ",[322,395,397],{"class":396},"sCsY4","// read from the clone\n",[322,399,401],{"class":324,"line":400},3,[322,402,403],{"class":396},"  // ...inspect body...\n",[322,405,407,410,413,416,419,422],{"class":324,"line":406},4,[322,408,409],{"class":345},"  return",[322,411,412],{"class":332}," proxyRequest",[322,414,415],{"class":328},"(event, ",[322,417,418],{"class":339},"\"/target\"",[322,420,421],{"class":328},"); ",[322,423,424],{"class":396},"// original stream still intact\n",[322,426,428],{"class":324,"line":427},5,[322,429,430],{"class":328},"});\n",[432,433,434],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":318,"searchDepth":365,"depth":365,"links":436},[437,438,439,440],{"id":197,"depth":400,"text":201},{"id":233,"depth":400,"text":236},{"id":242,"depth":400,"text":245},{"id":268,"depth":400,"text":271},"H3 proxy utilities.","md",{"automd":444,"icon":122},true,{"icon":122},{"title":119,"description":441},"kIfzfux8YeTFX3BPDnAjw0kQBOIxcR4TiDrZi0xj9S0",[449,451],{"title":114,"path":115,"stem":116,"description":450,"icon":117,"children":-1},"H3 security utilities.",{"title":124,"path":125,"stem":126,"description":452,"icon":127,"children":-1},"H3 MCP related utils.",1782193870315]