http-proxy-middleware icon indicating copy to clipboard operation
http-proxy-middleware copied to clipboard

Add documentation for http proxy middleware in API Routes Nextjs

Open phatify opened this issue 2 years ago • 2 comments

Describe the feature you'd love to see

Add documentation for http proxy middleware in API Routes Nextjs

Additional context (optional)

No response

phatify avatar Dec 27 '22 11:12 phatify

I've found the examples provided elsewhere don't work correctly on the first request. The first request triggers .on('upgrade') registration, causing subsequent requests to succeed. But the first request hangs indefinitely.

justin-together avatar Mar 16 '23 15:03 justin-together

@justin-together could you give concrete urls to the examples you are referring to?

Here you can find a Next.js recipe: https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/servers.md#nextjs

Documentation to subscribe to upgrade event manually: https://github.com/chimurai/http-proxy-middleware/blob/master/README.md#external-websocket-upgrade

Happy to hear what kind of document is missing and can be improved

chimurai avatar Mar 16 '23 19:03 chimurai