Skip to content

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

Closed

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,
});

Activity

  1. added
    extension
    feature request
    on Jul 20, 2022
  2. added
    api
    and removed
    extension
    on Jul 20, 2022
  3. peduarte commented on Jan 4, 2023

    @peduarte
    Contributor

    @whjvenyl Hey, is this still an issue for you in the latest version of Raycast 1.45.2? It has a new Proxy setting which is compatible with node-fetch
    image

  4. added a commit that references this issue on Apr 29, 2024
  5. added a commit that references this issue on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apifeature request

    Type

    No type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions