ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.51k stars 181 forks source link

Proxyman not capturing traffic on NextJS Edge runtime (middleware) #2114

Open Mahdhir opened 3 weeks ago

Mahdhir commented 3 weeks ago

Description

Proxyman is not capturing traffic on the edge runtime. But normal requests under the route handlers, and server components show up on proxyman.

Steps to Reproduce

  1. Clone https://github.com/Mahdhir/next-proxyman-issue
  2. Setup using manual/automatic mode and run the app and see the requests to jsonplaceholder.typicode show up on proxyman
  3. Modify the middleware.ts file by commenting the route handler fetch and uncomment the fetch call directly to the jsonplaceholder endpoint
  4. If you run the app now, you will notice the requests do not show up on proxyman

Current Behavior

Proxyman is not capturing traffic on the edge runtime next js middleware.

Expected Behavior

Proxyman should capture all traffic including next js middleware edge runtime.

Environment

Proxyman Version 5.7.0 (50700) | macOS: Version 14.6.1 (Build 23G93)

NghiaTranUIT commented 3 weeks ago

@Mahdhir you should use no-cache from your fetch. Ref: https://github.com/ProxymanApp/Proxyman/issues/2038#issuecomment-2143324535

Mahdhir commented 3 weeks ago

@Mahdhir you should use no-cache from your fetch. Ref: https://github.com/ProxymanApp/Proxyman/issues/2038#issuecomment-2143324535

@NghiaTranUIT 'no-cache' is already included. This works fine on normal server components. Only middlewares seem to cause an issue, probably because they have their own edge runtime.

NghiaTranUIT commented 3 weeks ago

yeah, it can be the case. NextJS might use their own logic to handle the middleware, so it might not use the Proxy setting.