Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy support #629

Open
XuJiandong opened this issue Jan 24, 2024 · 1 comment
Open

Proxy support #629

XuJiandong opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@XuJiandong
Copy link
Contributor

It seems that proxy can't work. I already set proxy as following:

❯ export | fgrep -i proxy
ALL_PROXY=http://127.0.0.1:7069
HTTPS_PROXY=http://127.0.0.1:7069
HTTP_PROXY=http://127.0.0.1:7069
all_proxy=http://127.0.0.1:7069
http_proxy=http://127.0.0.1:7069
https_proxy=http://127.0.0.1:7069

Still get errors, just these days.

❯ npx ts-node devnet-transfer.ts
/Users/xjd/projects/lumos/node_modules/.pnpm/[email protected]/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://testnet.ckb.dev/ failed, reason: connect EHOSTUNREACH 0.0.0.102:443 - Local (192.168.0.108:50763)
    at ClientRequest.<anonymous> (/Users/xjd/projects/lumos/node_modules/.pnpm/[email protected]/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:518:28)
    at ClientRequest.emit (node:domain:488:12)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:518:28)
    at TLSSocket.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'EHOSTUNREACH',
  code: 'EHOSTUNREACH'
}
@XuJiandong XuJiandong added the bug Something isn't working label Jan 24, 2024
@homura
Copy link
Collaborator

homura commented Jan 24, 2024

NodeJS does not support the http_proxy natively, we need to set up the proxy manually in the project.

Unfortunately, it seems that proxy information must be set on each call to http.request. Node does not include a mechanism for global proxy settings.

https://stackoverflow.com/questions/18586902/node-js-global-proxy-setting


Additionally, I use bun, a new JavaScript engine extention that can run TypeScript without extra settings, to run js with the proxy environment since bun supports the http_proxy env and typescript natively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants