Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

proxy-chain

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-chain - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

24

build/tools.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.tee = exports.parseProxyAuthorizationHeader = exports.redactParsedUrl = exports.redactUrl = exports.parseUrl = exports.isHopByHopHeader = exports.parseHostHeader = undefined;
exports.parseProxyAuthorizationHeader = exports.redactParsedUrl = exports.redactUrl = exports.parseUrl = exports.isHopByHopHeader = exports.parseHostHeader = undefined;

@@ -13,7 +13,6 @@ var _url = require('url');

var _through = require('through');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _through2 = _interopRequireDefault(_through);
// import through from 'through';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -142,9 +141,7 @@ var HOST_HEADER_REGEX = /^((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9]))(:([0-9]+))?$/;

* @return {through} duplex stream (pipe)
*/
var tee = exports.tee = function tee(name) {
var initialOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
export const tee = (name, initialOnly = true) => {
console.log('tee');
var maxChunks = 2;
var duplex = (0, _through2.default)(function (chunk) {
let maxChunks = 2;
const duplex = through((chunk) => {
if (maxChunks || !initialOnly) {

@@ -154,6 +151,6 @@ // let msg = chunk.toString();

maxChunks--;
console.log('pipe: ' + JSON.stringify({
console.log(`pipe: ${JSON.stringify({
context: name,
chunkHead: chunk.toString().slice(0, 100)
}));
chunkHead: chunk.toString().slice(0, 100),
})}`);
}

@@ -164,2 +161,3 @@ duplex.queue(chunk);

return duplex;
};
};
*/
{
"name": "proxy-chain",
"version": "0.1.0",
"version": "0.1.1",
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.",

@@ -43,5 +43,2 @@ "main": "build/index.js",

"bluebird": "^3.5.1",
"https-proxy-agent": "^2.1.0",
"portastic": "^1.0.1",
"through": "^2.3.8",
"underscore": "^1.8.3"

@@ -58,2 +55,3 @@ },

"chai": "^4.0.2",
"https-proxy-agent": "^2.1.0",
"eslint": "^3.19.0",

@@ -69,2 +67,3 @@ "eslint-config-airbnb": "^15.0.1",

"mocha": "^3.2.0",
"portastic": "^1.0.1",
"proxy": "^0.2.4",

@@ -74,2 +73,3 @@ "request": "^2.83.0",

"sinon-stub-promise": "^4.0.0",
"through": "^2.3.8",
"ws": "^3.3.1"

@@ -76,0 +76,0 @@ },

@@ -7,7 +7,12 @@ # proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
The authentication and proxy chaining configuration is defined in code and can be dynamic.
Note that the proxy server only supports Basic authentication
(see (Proxy-Authorization)[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization] for details).
For example, this library is useful if you need to use proxies with authentication
in the headless Chrome web browser, but don't feel like setting up Squid or some other proxy server.
The authentication and proxy chaining configuration is provided in code and can be dynamic.
in the headless Chrome web browser, because it doesn't accept proxy URLs such as `http://username:password@proxy.example.com:8080`.
With this library, you can setup a local proxy server without any password
that will forward requests to the upstream proxy with password.
## Run a simple HTTP/HTTPS proxy server

@@ -41,2 +46,11 @@

// If the function is not defined or is null, the server runs in a simple mode.
// Note that the function takes a single argument with the following properties:
// * request - An instance of http.IncomingMessage class with information about the client request
// (which is either HTTP CONNECT for SSL protocol, or other HTTP request)
// * username - Username parsed from the Proxy-Authorization header
// * password - Password parsed from the Proxy-Authorization header
// * hostname - Hostname of the target server
// * port - Port of the target server
// * isHttp - If true, this is a HTTP request, otherwise it's a HTTP CONNECT tunnel for SSL
// or other protocols
prepareRequestFunction: ({ request, username, password, hostname, port, isHttp }) => {

@@ -43,0 +57,0 @@ return {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc