Middleware rewrites to other origins
Middleware can now rewrite a request to another origin, as on Vercel:
Easel’s edge proxies the request to that origin with the request headers your middleware set. Before, only the path and query were kept and the page was served from your own app.
The middleware function ends as soon as it returns. The edge does the proxying, so no function stays open for the length of the request.
WebSockets through middleware
A WebSocket upgrade through a rewrite to another origin is proxied too, and quiet connections stay open for up to an hour. That covers cases like a dev server’s hot reload socket behind your app’s domain.
Host matchers
has and missing conditions in a middleware matcher now match as patterns, as Next.js does. A matcher like { type: "host", value: "p\\d+-.*" } runs your middleware for those hosts, where before it never matched.