question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Http Proxy

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pbassutcommented, Feb 15, 2021

You’re spot on. Likely a merging error. We’ll fix it ASAP

1reaction
igorantuncommented, Feb 11, 2021

@pbassut Although this PR allows passing an axios instance/options to this.axiosInstance, it doesn’t seem to be used later on. (I couldn’t find any occurence of this.axiosInstance outside the constructor)

Apparently it’s this.axiosClient that is actually used: (https://github.com/segmentio/analytics-node/blob/master/index.js#L290) and it receives neither the instance or the options passed to the constructor: https://github.com/segmentio/analytics-node/blob/master/index.js#L56

Am I missing something? Thanks for looking into this 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Proxy Support - Proxifier
HTTP proxy servers can process HTTP connections (port 80). They can also support HTTPS connections (SSL) but usually such connections are only allowed...
Read more >
About the HTTP-Proxy - WatchGuard Technologies
The HTTP-proxy is a high-performance content filter. It examines Web traffic to identify suspicious content that can be a virus or other type...
Read more >
Proxy servers and tunneling - HTTP - MDN Web Docs
When navigating through different networks of the Internet, proxy servers and HTTP tunnels are facilitating access to content on the World ...
Read more >
HTTP Proxy Meaning and How Does It Work? - Oxylabs
The HTTP proxy can essentially be described as a high-performance content filter that traffic flows through to reach you. In other words, it...
Read more >
Specifying your HTTP proxy settings - IBM
z/OSMF does not support HTTPS communication between any other combination of systems. The HTTP proxy definitions that are defined to z/OSMF are displayed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found