Closed NabiKAZ closed 2 weeks ago
Fixed setting fetch in 4.0.3
Thank you for your quick response. It worked well.
import Lens from 'chrome-lens-ocr'; //4.0.3
import fetch from 'node-fetch';
import { SocksProxyAgent } from 'socks-proxy-agent';
const proxyAgent = new SocksProxyAgent('socks://127.0.0.1:10808');
const lens = new Lens({
fetchOptions: {
agent: proxyAgent
},
}, fetch);
The main problem is with the set the SOCKS. It's even strange that HttpsProxyAgent doesn't work even though they are of the same type as ProxyAgent. I tested different modes which are listed below:
While all of these work well in the fetch agent.
In the guide, it is mentioned that the core can be used with fetch, so I tested the following codes, but I was unsuccessful.
Or:
My suggestion is to migrate from undici to node-fetch as the default library.