/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-examples-1d0be4a70646-examples-s0681-c0000.md
Examples (1) - hono-docs
Examples (1) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt examples Summary Simple usage: Compl...
Examples (1)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#examples
Summary
Simple usage: ts app.get('/proxy/:path', (c) => { return proxy(`http://${originServer}/${c.req.param('path')}`) }) Complicated usage: ``ts app.get('/proxy/:path', async (c) => { const res = await proxy( http://${originServer}/${...
Content
Simple usage:
app.get('/proxy/:path', (c) => {
return proxy(`http://${originServer}/${c.req.param('path')}`)
})Complicated usage:
app.get('/proxy/:path', async (c) => {
const res = await proxy(
`http://${originServer}/${c.req.param('path')}`,
{
headers: {
...c.req.header(), // optional, specify only when forwarding all the request data (including credentials) is necessary.
'X-Forwarded-For': '127.0.0.1',
'X-Forwarded-Host': c.req.header('host'),
Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization')
},
}
)
res.headers.delete('Set-Cookie')
return res
})Or you can pass the c.req as a parameter.