![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
proxying-agent
Advanced tools
Readme
This a Node http agent capable of forward proxying HTTP/HTTPS requests.
It supports the following:
The agent inherits directly from the http.Agent
Node object so it benefits from all
the socket handling goodies that come with it.
npm install proxying-agent
The following options are supported:
proxy
- Specifies the proxy url. The supported format is http[s]://[auth@]host:port
where auth
is the authentication information in the form of username:password
. The authentication information can also be
in the form of a Base64 encoded user:password
, e.g. http://dXNlcm5hbWU6cGFzc3dvcmQ=@proxy.example.com:8080
tunnel
- If true
then the proxy will become a tunnel to the server.
This should usually be true
only if the target server protocol is https
tlsOptions
- TLS connection options to use when the target server protocol is https
. See http://nodejs.org/api/tls.html#tls_tls_connect_options_callback for a list of available options.authType
- Proxy authentication type. Possible values are basic
and ntlm
(default is basic
).ntlm
- (beta) applicable only if authType
is ntlm
. Supported fields:
domain
(required) - the NTLM domainworkstation
(optional) - the local machine hostname (os.hostname() is not specified) var proxying = require('proxying-agent');
var proxyingOptions = {
proxy: 'http://proxy.example.com:8080'
};
var proxyingAgent = new proxying.ProxyingAgent(proxyingOptions);
var req = http.request({
host: 'example.com',
port: 80,
agent: proxyingAgent
});
var proxying = require('proxying-agent');
var proxyingOptions = {
proxy: 'http://proxy.example.com:8080',
tunnel: true
};
var proxyingAgent = new proxying.ProxyingAgent(proxyingOptions);
var req = https.request({
host: 'example.com',
port: 443,
agent: proxyingAgent
});
var proxying = require('proxying-agent');
var proxyingOptions = {
proxy: 'http://username:password@proxy.example.com:8080',
tunnel: true
};
var proxyingAgent = new proxying.ProxyingAgent(proxyingOptions);
var req = https.request({
host: 'example.com',
port: 443,
agent: proxyingAgent
});
When authenticating using NTLM it is important to delay sending the request data until the socket is assigned to the request. Failing to do so will result in the socket being prematurely closed, preventing the NTLM handshake from completing.
var proxying = require('proxying-agent');
var proxyingOptions = {
proxy: 'http://username:password@proxy.example.com:8080',
tunnel: true,
authType: 'ntlm',
ntlm: {
domain: 'MYDOMAIN'
}
};
var proxyingAgent = new proxying.ProxyingAgent(proxyingOptions);
var req = https.request({
host: 'example.com',
port: 443,
agent: proxyingAgent
});
req.on('socket', function(socket) {
req.write('DATA');
req.end();
});
Copyright 2013-2014 Capriza. Code released under the MIT license
FAQs
Node HTTP/HTTPS Forward Proxy Agent
The npm package proxying-agent receives a total of 11,797 weekly downloads. As such, proxying-agent popularity was classified as popular.
We found that proxying-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.