WARNING: THIS APPLICATION IS STILL DEVELOPING!!!
Koa version of http-proxy-middleware.
The current awesome "http-proxy-middleware"
is designed for connect / express. It will not call next()
when the proxy responses.
This will cause problem if simply use "koa-connect"
to adapt it.
Do not use any middleware like "bodyparser" before the proxy, otherwise requests with body (e.g. a POST) may hang. See the issue in node-http-proxy for more details.
import { createProxyMiddleware } from '@whitetrefoil/koa-http-proxy'
app.use(createProxyMiddleware(['/api'], { ...options }))
The options
here is the one of "node-http-proxy".
- Upgrade infrastructure to support ESM.
- Remove default export.
- Go back to
koa-connect
instead...
- Fix missing
.d.ts
files.
- Add a "native" version which won't fix HPE_UNEXPECTED_CONTENT_LENGTH (because the fix causes other problems).
- Upgrade esm version build to ES2018.
- Fix HPE_UNEXPECTED_CONTENT_LENGTH (causes changes in response headers).
- Prevent http-proxy from response directly, now other Koa middleware can interactive the response.
- Set
ctx.body
as aBuffer
.
- Upgrade TypeScript to stable.
- Upgrade dependencies.
- Fix "@whitetrefoil/deferred" used as dependency but required as devDependency.
- Print error message when proxy request failed.
- Add some logs to help debugging.
- Use dedicated server for each factory call.
- Fix a bug about response body.
- Initial release.