# tsproxy

> Typescript http and socks proxy server with authentication

Latest version **1.0.4** (published 2023-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install tsproxy
pnpm add tsproxy
yarn add tsproxy
bun add tsproxy
```

Provides the command `tsproxy`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-07-12 |
| First published | 2023-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 10 |
| Unpacked size | 107.5 KB |
| Known vulnerabilities | 0 (+9 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ilia Skripchenko |
| Maintainers | ilya7u |

## Links

- npm: https://www.npmjs.com/package/tsproxy
- Repository: https://github.com/ilya7u/tsproxy
- Homepage: https://github.com/ilya7u/tsproxy#readme
- Issues: https://github.com/ilya7u/tsproxy/issues
- npm.io page: https://npm.io/package/tsproxy

## Dependencies (10)

- [binary](https://npm.io/package/binary.md) ^0.3.0
- [domain](https://npm.io/package/domain.md) ^0.0.1
- [fastify](https://npm.io/package/fastify.md) ^4.19.2
- [@ts4/env](https://npm.io/package/@ts4/env.md) ^1.0.27
- [@ts4/log](https://npm.io/package/@ts4/log.md) ^1.0.45
- [commander](https://npm.io/package/commander.md) ^11.0.0
- [@fastify/cors](https://npm.io/package/@fastify/cors.md) ^8.3.0
- [eventemitter2](https://npm.io/package/eventemitter2.md) ^6.4.9
- [is-localhost-ip](https://npm.io/package/is-localhost-ip.md) ^2.0.0
- [@fastify/sensible](https://npm.io/package/@fastify/sensible.md) ^5.2.0

## Recent versions

- 1.0.4 (latest) — 2023-07-12
- 1.0.3 — 2023-07-12
- 1.0.2 — 2023-07-12

## README

# tsproxy is Typescript http and socks proxy server with authentication

## Install

    # Globally via npm
    npm install -g tsproxy

    # As a dependency in your npm package:
    npm install --save tsproxy

## Usage

```sh
$ tsproxy --help

  Usage: tsproxy [options] <url>

  Examples:
    tsproxy http                           - run http proxy on 0.0.0.0 host with 8080 port
    tsproxy socks                          - run socks proxy on 0.0.0.0 host with 1080 port
    tsproxy http://127.0.0.0:8888          - run http proxy
    tsproxy socks://user@pass:0.0.0.0:4444 - run socks proxy with authentication

  Arguments:
    url            url to listen or http/socks word

  Options:
    -v, --verbose  verbosity that can be increased (ex: -vvvv)
    -h, --help     display help for command
```

## Running on-demand

Using `npx` you can run the script without installing it first:

    npx tsproxy http://0.0.0.0:8888

## Library

```typescript
import { HttpProxyServer, SocksProxyServer } from 'tsproxy';

const server = new HttpProxyServer({
    auth: {
        username: 'bob',
        password: 'pass',
    },
    verbose: true,
});

(async () => {
    await server.listen();
})();
```

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