An implementation of LCX (HTRAN) under Golang

By proactively connecting to a computer with a public IP address to open a tunnel, the Intranet can be penetrated so that the services provided by Intranet hosts can be accessed by external hosts. Software implemented port forwarding, transparent proxy, can bypass the firewall when the host limits inbound rules but does not limit outbound rules.

build

go build nb.go

If no message is displayed, the compilation succeeds. (Linux philosophy: No news is the best news)

Run the./nb command in the current directory for Linux or Mac OS, and run nb.exe in the current directory for Windows. If the welcome message is displayed, everything is normal.

If there is a compilation error, please check whether golang on the current system is broken. It is recommended to try again after reinstallation or directly download the compiled binary file. See below for the download address.

If an error occurs, check whether the parameters you entered are incorrect or the corresponding port is occupied. Change the port and try again. If you do not see the welcome message, set permission to 777 for the compiled executable file. If logs cannot be written, check whether the current user has the read and write permission on the log file path.

platform

  • Windows 7 7601 + GO1.7.5 (Windows/AMD64) Compiled and tested successfully
  • Ubuntu 16.04.1 + go1.6.2(Linux /amd64) compiled and tested successfully
  • Windows 2003 SP2 3790 + GO1.9.1 (Windows /386) compiled and tested successfully

grammar

  • -listen port1 port2

The sample

nb -listen 1997 2017


instructions

The local starts listening on port1. When port1 receives an active connection from the client, NB actively connects to IP :port2 and forwards data between port1 and IP :port2.

grammar

  • -slave ip1:port1 ip2:port2

The sample

Nb - slave 127.0.0.1:3389 8.8.8.8:1997


The sample

nb -listen 1997 2017 -log D:/nb

Nb-tran 1997 192.168.1.2:338-log D:/ NB

Nb-slave 127.0.0.1:3389 8.8.8.8:1997 -log D:/nb

TODO

  • UDP forwarding support