# tiny-proxy-chain

> Proxy chain

Latest version **2.0.2** (published 2026-07-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install tiny-proxy-chain
pnpm add tiny-proxy-chain
yarn add tiny-proxy-chain
bun add tiny-proxy-chain
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-07-28 |
| First published | 2021-08-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 66.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Oleg Orlov |
| Maintainers | orlv |

## Links

- npm: https://www.npmjs.com/package/tiny-proxy-chain
- Repository: https://github.com/orlv/tiny-proxy-chain
- Homepage: https://github.com/orlv/tiny-proxy-chain#readme
- Issues: https://github.com/orlv/tiny-proxy-chain/issues
- npm.io page: https://npm.io/package/tiny-proxy-chain

## Dependencies (2)

- [socks](https://npm.io/package/socks.md) ^2.8.9
- [socks-proxy-agent](https://npm.io/package/socks-proxy-agent.md) ^8.0.5

## Recent versions

- 2.0.2 (latest) — 2026-07-28
- 2.0.1 — 2024-05-18
- 2.0.0 — 2024-04-03
- 1.7.2 — 2023-10-20
- 1.7.1 — 2023-06-01
- 1.7.0 — 2023-05-11
- 1.6.1 — 2023-04-26
- 1.6.0 — 2023-03-17
- 1.5.0 — 2023-02-04
- 1.4.1 — 2022-04-28
- 1.4.0 — 2022-04-26
- 1.3.1 — 2022-01-27
- 1.3.0 — 2021-11-27
- 1.2.2 — 2021-08-28

## README

# Tiny Proxy Chain

Tiny Proxy Chain is a lightweight tool for Node.js that helps set up a chain of proxies for HTTP and HTTPS traffic. It's designed to be easy and straightforward.

### Install

```shell
npm i -D tiny-proxy-chain
```

### Example of usage

```javascript
const TinyProxyChain = require('tiny-proxy-chain')

new TinyProxyChain({
  listenPort: 8080,
  proxyURL: 'http://other-proxy-host:port',
  proxyUsername: 'other-proxy-user',
  proxyPassword: 'other-proxy-password',
  debug: false,
  key: fs.readFileSync('./keys/privkey.pem'),
  cert: fs.readFileSync('./keys/cert.pem'),
  ca: fs.readFileSync('./keys/chain.pem'),
  connectionTimeout: 60000,
  onRequest: (req, defaultProxyOptions) => {
    console.log(`${req.method} ${req.url} HTTP/${req.httpVersion}`)

    if (req.headers['proxy-authorization'] !== TinyProxyChain.makeAuth('tiny-proxy-username', 'tiny-proxy-password')) {
      req.socket.write(
        `HTTP/${req.httpVersion} 407 Proxy Authentication Required\r\n` +
        `Proxy-Authenticate: Basic\r\n\r\n`
      )
    } else {
      delete req.headers['proxy-authorization']
      return defaultProxyOptions
    }
  }
}).listen()
```

### Test

To test Tiny Proxy Chain, you'll need Docker installed on your machine.

```js
npm test
```

---
_Source: https://npm.io/package/tiny-proxy-chain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
