Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-proxyt
TCP proxy CLI with optional TLS support in pure Node.JS
https://github.com/bahamas10/node-proxyt
Last synced: about 2 months ago
JSON representation
TCP proxy CLI with optional TLS support in pure Node.JS
- Host: GitHub
- URL: https://github.com/bahamas10/node-proxyt
- Owner: bahamas10
- Created: 2020-01-07T17:48:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-07T16:57:26.000Z (over 1 year ago)
- Last Synced: 2024-05-08T20:01:01.775Z (8 months ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
proxyt
======TCP proxy CLI with optional TLS support in pure Node.JS
About
-----I wrote `proxyt` to be a simple tool that makes spinning up a TCP proxy (with
optional TLS) support an easy task. I normally use `nc` whenever I need a
simple proxy, but I wanted something with slightly more functionality that
worked across multiple operating systems without needing to be recompiled.
Since I already use Node everywhere at home, this seemed like an obvious fit.I also wanted something that could reload certificates without having to be
shut down / restarted. `proxyt` takes a `-i ` option (explained
below) that will cause the certs to be reloaded automatically on a set
interval.All logging is done via [Bunyan](https://github.com/trentm/node-bunyan).
Install
-------npm install -g proxyt
Examples
--------### TCP proxy
Listen on all interfaces on port 80 and forward incoming requests to 10.0.1.234
on port 8080.proxyt 0.0.0.0:80 10.0.1.234:8080
### TCP proxy with TLS
proxyt -s -k pem.key -c pem.cert 0.0.0.0:443 10.0.1.234:8080
Listen on all interfaces on port 443 using TLS and forward incoming requests to
10.0.1.234 on port 8080.### TCP proxy with TLS and advanced options
proxyt -s -k pem.key -c pem.cert -i 86400 -H my-host.example.com 0.0.0.0:443 10.0.1.234:8080
Listen on all interfaces on port 443 using TLS and forward incoming requests to
10.0.1.234 on port 8080. Also, reload the cert and key every 86400 seconds
(every day) and verify that the incoming SNI hostname matches `my-host.example.com`.Usage
-----$ proxyt -h
Usage: proxyt [options]Example:
Listen on all interfaces on port 80 (locally) and forward
incoming requests to 10.0.1.234 on port 8080$ proxyt 0.0.0.0:80 10.0.1.234:8080
Listen locally via TLS on port 443 (locally) and forward incoming
requests to 1.2.3.4 on port 5678$ proxyt -s -k pem.key -c pem.cert 127.0.0.1:443 1.2.3.4:5678
Options:
-c, --cert [env PROXYT_CERT] certificate file to use (requires -s)
-H, --sni-host [env PROXYT_SNI_HOST] SNI Hostname (optional), connections that do not match will be dropped
-h, --help print this message and exit
-i, --interval [env PROXYT_INTERVAL] interval in seconds to reload TLS key and cert, defaults to none
-k, --key [env PROXYT_KEY] key file to use (requires -s)
-l, --log-level [env PROXYT_LOG_LEVEL] bunyan log level to use, defaults to info
-n, --no-dns [env PROXYT_NO_DNS] do not attempt to resolve IP addresses
-s, --use-tls [env PROXYT_USE_TLS] enable tls, requires -c and -k be set
-v, --version print the version number and exitLicense
-------MIT License