Open TimvdEijnden opened 9 months ago
@TimvdEijnden can you try using the Automatic Setup to start the pre-configured Terminal app, then starting your local backend here.
This Terminal has a lot of Global HTTP, and HTTPS env, so it might work with the ofetch
out of the box. axios
is already worked.
Docs: https://docs.proxyman.io/automatic-setup/automatic-setup
Yes I also tried the automatic setup, same issue
@TimvdEijnden Can you show me your setup ?
I tested and Proxyman supports ofetch
out of the box.
const { ofetch } = require("ofetch");
// Call start (async () => { const data = await ofetch("https://httpbin.proxyman.app/get?lib=ofetch"); console.log(data); })();
2. Open Proxyman -> Automatic Setup -> Start new Terminal
3. Run this script `npm start`
4. Result:
- Able to capture & decrypt HTTPS requests from `ofetch`
![CleanShot 2023-10-06 at 16 34 02@2x](https://github.com/ProxymanApp/Proxyman/assets/5878421/f6a4c08b-28bd-46c9-bb45-b03ed63a745e)
Video:
https://github.com/ProxymanApp/Proxyman/assets/5878421/10f8b384-5ba8-4fba-aca2-c5dfd52b99e0
@NghiaTranUIT wow 🤩 thanks for quickly diving into it! I'll create a test nuxt 3 project and try again. Might be related to nuxt 3 instead of ofetch then.
yes, Nuxt have a problem:
ERROR [unhandledRejection] socket hang up 3:39:00 AM
at Socket.socketOnEnd (node:_http_client:524:23)
at Socket.emit (node:events:530:35)
at Socket.emit (node:domain:488:12)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) (repeated 3503 times)
Yes I also tried with nuxt 3 and it does not boot up just like @reslear mentions.
@pi0 @danielroe Is there something I can do, I'm willing to dive into it and even make a PR if needed
@TimvdEijnden Not familiar with the problem here, so take this with a pinch of salt. If you're prepared to have a look, you might investigate the way we create a 'local fetch' with unenv. We mock internal network requests to avoid hitting the network layer.
Feel free to ping me if I can help with pointing you to the way fetch is architected, once you dig down deeper and start finding what's causing the error here. 🙏
Description
Currently https://github.com/unjs/ofetch is not supported, which is used by nuxt 3.
Why this feature/change is important?
Before we were using axios which was supported.
Now we're ending up with these errors and cannot override requests: