Comments (3)
Can you show some example code please?
from proxy-agents.
Ok some context ... I am constantly pained with a corporate proxy thing. We have a bunch of angular thingies so angular-cli is the flavour of the month here. Hence I am running ng serve --proxy-config proxy.conf.js
. The code in proxy.conf.js
is something along these lines.
const HttpsProxyAgent = require('https-proxy-agent');
const PROXY_CONFIG = [
{
agent: new HttpsProxyAgent(process.env.HTTPS_PROXY || process.env.HTTP_PROXY),
context: [
"/api",
"/uat",
"/meow"
],
target: {
host: "my.awesome.api.com",
protocol: "https:",
port: 443
},
secure: false,
changeOrigin: true,
logLevel: "debug"
}
]
module.exports = PROXY_CONFIG;
So now if you make a request using curl, through the angular cli server which for me is on localhost:4200/api
with an Authorization
header, that header will not make it to the server hosting the https://my.awesome.api.com/api
.
Now admittedly I haven't investigated properly what the angular cli thingie is actually doing with agent. However when I was reading through the code I made the assumption that headers from the original request are possibly ignored eg.
var headers = Object.assign({}, proxy.headers);
To be honest, I only read through the code... I'd be happy to write a test to prove it and/or raise a pull request if it is on this side instead of on the angular cli thingie
from proxy-agents.
This module has gone through a large refactor and modernization. I am closing this issue as a bit of house cleaning. If you feel that this issue still exists in the latest release, feel free to open a new issue.
from proxy-agents.
Related Issues (20)
- Need HttpsProxyAgent to support setting the CA Cert HOT 1
- Feature request: support undici (native fetch)
- critical security vulnerablility in dependency vm2 HOT 1
- Can't set secureOptions HOT 5
- tag / release 6.0.0 missing HOT 1
- how to handle simple raw net (not http) connection with tls
- RequestError: Unexpected agent option: _events
- Use `rejectUnauthorized` without proxy URL HOT 3
- endpoints_resolution_error after upgrading from "5.0.0" to "6.3.1" HOT 1
- Move license information to separate file for packages HOT 2
- Timeout option doesn't work as expected HOT 2
- Any method to listen for data on proxy server? HOT 2
- `proxy` package missing `bin` field
- Can't set jar when createCookieAgent(httpProxyAgent.HttpProxyAgent)
- localAddress settings doesn't work HOT 1
- Feature Request: Allow `getProxyForUrl` to be asynchronous HOT 1
- [proxy] how to specify SSL certs/keys? HOT 2
- Issue on a dependency - CVE-2023-37466 & CVE-2023-37903 HOT 2
- [BUG]: EPIPE socket "error" event after "end" event
- how to build the entire package to generate the same output as installing in a node_modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxy-agents.