Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

anzerr/tcp.proxy

Repository files navigation

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);
	});
});

About

Tunnel a tcp connection

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /