opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

HTTP Proxy Support

Open ghost opened this issue 4 years ago • 7 comments

Is there a way to use an HTTP Proxy with this module? I'm trying to debug some requests.

ghost avatar Apr 10 '22 08:04 ghost

If you want a janky way, you can use Browserify and then run it in chrome, and inspect the network requests through chrome.

caupcakes avatar Apr 18 '22 07:04 caupcakes

I'm also searching for this option, let me know if you found something :)

surikata avatar Apr 26 '22 09:04 surikata

Any specific reason why you want to use an HTTP Proxy?

esteban-OpenSea avatar Jun 16 '22 18:06 esteban-OpenSea

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

daxuanxiaoyou avatar Jun 29 '22 09:06 daxuanxiaoyou

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 (node:internal/main/run_main_module:17:47) Process exited with code 1

ahjohnwon avatar Jul 05 '22 18:07 ahjohnwon

我也遇到了同样的问题,本地系统使用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'
}

zeqi avatar Oct 13 '22 04:10 zeqi

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.

github-actions[bot] avatar May 24 '23 04:05 github-actions[bot]