Skip to content
Mr.2 can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Zero-Configuration.
Go Shell
Branch: master
Clone or download

Latest commit

Latest commit e057dbf Mar 27, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Delete FUNDING.yml Mar 8, 2020
cli/mr2 love nami Mar 27, 2020
.gitignore love nami Mar 27, 2020
.travis.yml ci May 17, 2019
LICENSE coming soon... Apr 25, 2019
OPENSOURCELICENSES prepare to opensource Apr 28, 2019
README.md love nami Mar 27, 2020
buildPB.sh prepare to opensource Apr 28, 2019
client.go import encrypt lib Mar 22, 2020
init.go fixed #11 May 17, 2019
mr2.pb.go fixed #11 May 17, 2019
mr2.proto fixed #11 May 17, 2019
server.go import encrypt lib Mar 22, 2020
tcpclient.go close by koa server Jun 16, 2019
tcpserver.go close by koa server Jun 16, 2019
test_test.go fixed #11 May 17, 2019
udpclient.go fixed #8 May 19, 2019
udpserver.go fixed #11 May 17, 2019

README.md

Mr.2

Build Status License: GPL v3

What is Mr.2

Mr.2 can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Keep it simple, stupid.

Install via nami

$ nami install github.com/txthinking/mr2

or download from releases or go get github.com/txthinking/mr2/cli/mr2.

Server

$ mr2 server -l :9999 -p password

# Only allow partial ports, and set password on each port
$ mr2 server -l :9999 -P '5678 password' -P '6789 password1'

Client

# Local server is 127.0.0.1:1234, expect to expose: server_address:5678
$ mr2 client -s server_address:port -p password -P 5678 -c 127.0.0.1:1234

# Local web root is /path/to/www, expect to expose: server_address:5678
$ mr2 client -s server_address:port -p password -P 5678 --clientDirectory /path/to/www

Example

Access local HTTP server

$ mr2 client -s server_address:port -p password -P 5678 -c 127.0.0.1:8080

# then
Your HTTP server in external network is: server_address:5678

SSH into local computer

$ mr2 client -s server_address:port -p password -P 5678 -c 127.0.0.1:22

# then
$ ssh -oPort=5678 user@server_address

Access local DNS server

$ mr2 client -s server_address:port -p password -P 5678 -c 127.0.0.1:53

# then
Your DNS server in external network is: server_address:5678

$ dig github.com @server_address -p 5678

Access your local directory via HTTP

$ mr2 client -s server_address:port -p password -P 5678 --clientDirectory /path/to/www

# then
A HTTP server in external network is: server_address:5678

Any TCP-based/UDP-based ideas you think of

...

Contributing

Please read CONTRIBUTING.md first

License

Licensed under The GPLv3 License

You can’t perform that action at this time.