# Globally via npm
npm install -g tsproxy
# As a dependency in your npm package:
npm install --save tsproxy
$ 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
Using npx
you can run the script without installing it first:
npx tsproxy http://0.0.0.0:8888
import { HttpProxyServer, SocksProxyServer } from 'tsproxy';
const server = new HttpProxyServer({
auth: {
username: 'bob',
password: 'pass',
},
verbose: true,
});
(async () => {
await server.listen();
})();