Support Http Proxy
See original GitHub issueAxios 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:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’re spot on. Likely a merging error. We’ll fix it ASAP
@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 ofthis.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#L56Am I missing something? Thanks for looking into this 😃