@anzerr/tcp.proxy
TypeScript icon, indicating that this package has built-in type declarations

1.0.13 • Public • Published

Intro

GitHub Actions status | publish

Tunnel a tcp connection to a remote socket and listen/edit the traffic through the tunnel.

Install

npm install --save git+https://github.com/anzerr/tcp.proxy.git
npm install --save @anzerr/tcp.proxy

Example

const Proxy = require('tcp.proxy');

let p = new Proxy('localhost:5670', 'localhost:5671');

p.on('connect', (tunnel) => {
	tunnel.on(Proxy.RX, (data, resolve) => {
		console.log(Proxy.RX, tunnel.key, data.toString());
		resolve(data);
	}).on(Proxy.TX, (data, resolve) => {
		console.log(Proxy.TX, tunnel.key, data.toString());
		resolve(data);
	}).on('close', () => {
		console.log('tunnel closed', tunnel.key);
	});
});

Package Sidebar

Install

npm i @anzerr/tcp.proxy

Weekly Downloads

2

Version

1.0.13

License

MIT

Unpacked Size

7.92 kB

Total Files

8

Last publish

Collaborators

  • anzerr