Proxy in forge cli

Hi,

How do I use corporate proxy to connect to forge using cli.

forge login --email *****@gmail.com --token ****** --non-interactive --verbose
error: [LaunchDarkly] network error (Error: connect ETIMEDOUT 151.101.206.217:443)
Log in to your Atlassian account
Press Ctrl+C to cancel.

Logging you in...

  ▶️  GraphQL https://api.atlassian.com/graphql
Query: 
        query forge_cli_getUserDetails {
          me {
            user {
              name
              accountStatus
              accountId
            }
          }
        }
Variables: {}
  request to https://api.atlassian.com/graphql failed, reason: connect ETIMEDOUT 104.192.142.13:443

Error: We couldn't log you in with those credentials. Check your email address and token before rerunning the command.

Error: We couldn't log you in with those credentials. Check your email address and token before rerunning the command.
    at loginCommandHandler (/opt/homebrew/lib/node_modules/@forge/cli/out/command-line/register-authentication-command.js:41:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.actionProcessor (/opt/homebrew/lib/node_modules/@forge/cli/out/command-line/command.js:78:32)

Hi does this thread answer the question?

We currently don’t have a way for the CLI to accept proxy credentials. There are people who have been able to get a system working like here

It’s been prioritised, but we cannot commit to a timeline to deliver the CLI change.

https://ecosystem.atlassian.net/browse/FRGE-517

@JoshuaHwang No it doesn’t solve my problem

How are we supposed to take part in codegeist 2022 if we are not able to connect via forge itself ?

To get Forge working in my corporate environment:

  1. Install global-agent: npm install -g global-agent
  2. Set environment variable: export GLOBAL_AGENT_HTTP_PROXY=http://localhost:3128
  3. Add as second line in /usr/bin/forge: require(‘global-agent/bootstrap’);

This was helping with DNS resolution errors, like getaddrinfo ENOTFOUND app.launchdarkly.com