1.0.4 • Published 10 months ago

tsproxy v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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

$ 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

import { HttpProxyServer, SocksProxyServer } from 'tsproxy';

const server = new HttpProxyServer({
    auth: {
        username: 'bob',
        password: 'pass',
    },
    verbose: true,
});

(async () => {
    await server.listen();
})();