Skip to content

Node-Fetch doesn't play well with proxy configurations #2311

@whjvenyl

Description

@whjvenyl

Describe the feature and the current behavior/state.

The node-fetch module used to do requests doesn't support environment proxy configurations. Changing the agent used would allow, to properly use extensions behind a company firewall.

const agent = new https.Agent({ rejectUnauthorized: !prefs.unsafeHTTPS });

to something along the lines of

import { getProxyHttpAgent } from "proxy-http-agent";
...
const proxyUrl = process.env.HTTP_PROXY || process.env.http_proxy || `http://localhost:7070`;
const agent: http.Agent = getProxyHttpAgent({
  proxy: proxyUrl,
  rejectUnauthorized: !prefs.unsafeHTTPS,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiIssues related to APIfeature requestNew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions