HTTP Proxy Support
Is there a way to use an HTTP Proxy with this module? I'm trying to debug some requests.
If you want a janky way, you can use Browserify and then run it in chrome, and inspect the network requests through chrome.
I'm also searching for this option, let me know if you found something :)
Any specific reason why you want to use an HTTP Proxy?
Any specific reason why you want to use an HTTP Proxy?
yes,man. i want proxy too. In my location, i can't use api to fetch datas directly; i want to use the api with the proxy to fetch them
The same to me...
Untitled-1.js:46
Uncaught FetchError FetchError
at loadESM (node:internal/process/esm_loader:94:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
--- async function ---
at runMainESM (node:internal/modules/run_main:51:21)
at executeUserEntryPoint (node:internal/modules/run_main:74:5)
at
我也遇到了同样的问题,本地系统使用ClashX开启了代理
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
我可以直接使用curl得到结果
curl "https://testnets-api.opensea.io/api/v1/asset/0x11484accf5fe0f8f6b4e8ae1b45bb00ee2a9d307/47/?"
也可以使用axios访问得到结果
const axios = require('axios');
const url = 'https://testnets-api.opensea.io/api/v1/asset/0x11484accf5fe0f8f6b4e8ae1b45bb00ee2a9d307/47/';
(async () => {
const res = await axios.get(url);
console.log(res.data);
})();
但opensea-js貌似没有使用该代理,抛出如下错误,我该如何解决?
DEPRECATED: Please use providerUtils.standardizeOrThrow() instead
DEPRECATED: Please use providerUtils.standardizeOrThrow() instead
/Users/<whoami>/study/web3/test/node_modules/node-fetch/lib/index.js:1491
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
^
FetchError: request to https://testnets-api.opensea.io/api/v1/asset/0x11484accf5fe0f8f6b4e8ae1b45bb00ee2a9d307/47/? failed, reason: connect ETIMEDOUT 108.160.167.156:443
at ClientRequest.<anonymous> (/Users/<whoami>/study/web3/test/node_modules/node-fetch/lib/index.js:1491:11)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.