damproxy

0.1.9 • Public • Published

可以将公网(WAN)主机流量转到内网(LAN)主机的反向代理工具库,实现了内网穿透。采用多链接+配对的方式实现,支持TCP、HTTP、SSH协议等。

A reverse proxy tool which can let WAN server's data flows to LAN server. support TCP, HTTP, SSH or others protocol based on TCP.

Getting started

Prepare a WAN server and a LAN server. Follow the steps on both of servers.

  1. Download and install Node.js(>=12.0.0).
  2. Install damproxy
$ npm i damproxy -g

WAN Server

Simple usage, forward data from port 80 and 443 to LAN server:

$ damproxy listen --forward-ports 80 443

Full options:

$ damproxy listen --host 0.0.0.0 --port 8991 --pwd mypassword --forward-ports 80@17080 443@17443

Options

--host

Host for LAN server connection, default 0.0.0.0.

--port

Port for LAN server connection, default 8991.

--pwd

Set the password to identify LAN server. Should less than 32 characters.

--forward-ports

Specify the port that will receive data from real client, then it will forward to the LAN server via the secondary port as outbound port. 80@17080 means receive data from 80 and forward to LAN server that output via 17080. Defaults the secondary port will automatically provided. May specify it in whitelist situation.


LAN Server

Simple usage, connect to WAN server

$ damproxy connect --host x.x.x.x --forward-ports 80

Full options:

$ damproxy connect --host x.x.x.x --port 8991 --pwd mypassword --forward-ports 80 443@20443 22@192.168.0.102:22

Options

--host

WAN server's host to connect.

--port

WAN server's port to connect, default 8991.

--pwd

Send the password to WAN server. Should less than 32 characters.

--forward-ports

Whitelist of forwarding port and specify a redirect address. It formed by A@B:C which means allowing data from WAN server's port A and send it to B:C. 80 equivalent to 80@127.0.0.1:80 and 80:8080 equivalent to 80@127.0.0.1:8080.

Package Sidebar

Install

npm i damproxy

Weekly Downloads

0

Version

0.1.9

License

MIT

Unpacked Size

33 kB

Total Files

10

Last publish

Collaborators

  • leecjson