Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Support Http Proxy #224

@chanind

Description

@chanind

Axios works with http proxies, but this library doesn't expose a way to configure the http proxy setting, at least as far as I can tell. I can make this work by doing the following:

// hackily import axios out of the analytics-node module
import analyticsAxios from 'analytics-node/node_modules/axios';
analyticsAxios.defaults.proxy = {
  host: 'x.x.x.x',
  port: 1234,
};

and in package.json:

  "resolutions": {
    "analytics-node/axios": "^0.19.0"
  }

Axios before 0.19.0 has a bug with https proxies, so I needed to upgrade the version of axios used by analytics-node to 0.19.0, since the currently published version is not on 0.19.0 yet.

Is there a less hacky way to accomplish this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions