Coder Social home page Coder Social logo

txthinking / zoro Goto Github PK

View Code? Open in Web Editor NEW
1.5K 28.0 127.0 10.3 MB

zoro can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Zero-Configuration.

Home Page: https://www.txthinking.com

License: GNU General Public License v3.0

Go 96.84% Shell 3.16%
expose tunnel proxy firewall tcp udp nat zero-configuration

zoro's Introduction

zoro

中文

zoro (mr2) can help you expose local server to external network. Support both TCP/UDP, of course support HTTP/HTTPS. Keep it simple, stupid.

❤️ A project by txthinking.com

Install via nami

nami install zoro

Install via brew

brew install zoro

Usage

NAME:
   zoro - Expose local TCP and UDP server to external network

USAGE:
   zoro [global options] command [command options] [arguments...]

COMMANDS:
   server       Run as server mode
   client       Run as client mode
   httpsserver  Run as https server mode
   httpsclient  Run as https client mode
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

server and client

On remote server. Note that the firewall opens TCP and UDP on all relevant ports

$ zoro server --listen :9999 --password password

More parameters: $ zoro server --help

On local. Assume your remote zoro server is 1.2.3.4:9999, your local server is 127.0.0.1:8080, want the remote server to open port 8888

$ zoro client --server 1.2.3.4:9999 --password password --serverport 8888 --client 127.0.0.1:8080

More parameters: $ zoro client --help

Then access 1.2.3.4:8888 equals to access 127.0.0.1:8080

httpsserver and httpsclient

On remote server. Assume your domain is domain.com, cert of *.domain.com is ./domain_com_cert.pem and ./domain_com_cert_key.pem, want https listen on 443. Note that the firewall opens TCP on all relevant ports

$ zoro httpsserver --listen :9999 --password password --domain domain.com --cert ./domain_com_cert.pem --key ./domain_com_cert_key.pem --tlsport 443

More parameters: $ zoro httpsserver --help

On local. Assume your remote zoro httpsserver is 1.2.3.4:9999, your local HTTP 1.1 server is 127.0.0.1:8080, want the remote server to open subdomain hello

$ zoro httpsclient --server 1.2.3.4:9999 --password password --subdomain hello --client 127.0.0.1:8080

More parameters: $ zoro httpsclient --help

Then access https://hello.domain.com:443 equals to access http://127.0.0.1:8080

Example of server and client

Expose local HTTP server

$ zoro client --server 1.2.3.4:9999 --password password --serverport 8888 --client 127.0.0.1:8080

Then access 1.2.3.4:8888 equals to access 127.0.0.1:8080

Expose local SSH

$ zoro client --server 1.2.3.4:9999 --password password --serverport 8888 --client 127.0.0.1:22

Then access 1.2.3.4:8888 equals to access 127.0.0.1:22

$ ssh -oPort=8888 [email protected]

Expose local DNS server

$ zoro client --server 1.2.3.4:9999 --password password --serveport 8888 --client 127.0.0.1:53

Then access 1.2.3.4:8888 equals to access 127.0.0.1:53

$ dig github.com @1.2.3.4 -p 8888

Expose local directory via HTTP

$ zoro client --server 1.2.3.4:9999 --password password --serverport 8888 --dir /path/to/www --dirport 8080

Then access 1.2.3.4:8888 equals to access 127.0.0.1:8080, web root is /path/to/www

Expose any TCP/UDP service

...

About UDP

In some cases of multi-layer NAT, UDP may fail. I passed the test when I connected directly to the Wi-Fi provided by the ISP.

License

Licensed under The GPLv3 License

zoro's People

Contributors

0xflotus avatar honwen avatar monkeywithacupcake avatar rpomykala avatar txthinking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zoro's Issues

Not opening on windows

It opens as a cmd page and suddenly closes itself in 1 second. I don't know what to do.

open server port bind to 127.0.0.1

--serverport=8088. ==> --serveraddr=127.0.0.1:8088

so we can access exposed service on this server, not public.

this can be useful when make exposed service under control, for example:

desktopWindows on Lan 3389 ==> zoro server expose 127.0.0.1:3389 ===> remote desktop gateway like Guacamole ==> user

what happen when print unexpected EOF ?

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version:
  • Server Operating System:Win10
  • Server Operating System Version:
  • Server Operation System Language:
  • Client Operating System:Win10
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Current Behavior

Detailed Description

Possible Solution

image

Is there some illegal chars ?

UDP Exposure

Prerequisites

  • [ * ] Did you search in issues?
  • [ * ] Are you running the latest version?
  • [ * ] I will write this according to this template.

Environment

  • Mr.2 Version:
  • Server Operating System: Windows 10
  • Server Operating System Version: 1904
  • Server Operation System Language: English
  • Client Operating System: Ubuntu
  • Client Operating System Version: 18.04
  • Client Operation System Language: English

How do I expose a udp port?

Invalid Host header

Hi got the message -> Invalid Host header <- when test a flask api the command that run is
zoro httpsclient -s zoro.ooo:9999 -p zoro -c 127.0.0.1:3000

在ubuntu上服务端运行不起来

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: latest
  • Server Operating System: ubuntu
  • Server Operating System Version: 18.04
  • Server Operation System Language: english
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

启动mr2的服务端

Current Behavior

执行指令:./mr2_linux_arm64 server -l :9999 -p password

Detailed Description

显示:
-bash: ./mr2_linux_arm64: cannot execute binary file: Exec format error

Possible Solution

About 7-10s after closing MR.2, the port is still unavailable

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: latest
  • Server Operating System: win10
  • Server Operating System Version:
  • Server Operation System Language:
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Current Behavior

Detailed Description

Possible Solution

Hey, I close MR.2 using CTRL-C in win 10 cmd. if start it immediately, it prints the port is still in using. After about 7-10 seconds, I can start it normally. Is this expected? Is there command to close it immediately?
Note:there is no other process using the same port.

Support proxy multiple local ports

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version:
  • Server Operating System:
  • Server Operating System Version:
  • Server Operation System Language:
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Current Behavior

Detailed Description

Possible Solution

Server on Linux, client on Windows does NOT work

On the Linux server (64bit Ubuntu) I started it like this:
./mr2 server -p xyzabc -l :9999

(on the ufw firewall at Linux and even at the Amazon Networking permissions, I opened both ports: 9999 and 8980 )

I started a small localhost webserver at 127.0.0.1:8980

Then I started this on Windows
mr2 client -s 65.1.164.105:9999 -p xyzabc --serverPort 8980 -c 127.0.0.1:8980
But when I browsed to
http://65.1.164.105:8980

It does NOT connect

What may I be doing wrong? Thanks!

Additional info:
When I do ctrl-c on the Linux server command, I get this message after it quits: " use of closed network connection" Is that a clue?

broken pipe | dial tcp : i/o timeout

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: v20190506
  • Server Operating System: Ubuntu
  • Server Operating System Version: 18.04
  • Server Operation System Language:
  • Client Operating System: Ubuntu
  • Client Operating System Version: 18.04
  • Client Operation System Language:

Expected Behavior

iperf3 speedtest ok

Current Behavior

fail

Detailed Description

  • iperf3 -s -p 5201
  • mr2 server -l :6060 -p pw
  • mr2 client -s 127.0.0.1:6060 -p pw -P 5202 -c 127.0.0.1:5201
  • iperf3 -c 127.0.0.1 -p 5202

Log of iperf3 -c:

127.0.0.1:5202
2019/05/10 11:44:42 write tcp 127.0.0.1:54898->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:54908->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:54940->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:54960->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:54962->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55092->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55144->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55176->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55184->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55174->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55196->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55240->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55296->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55284->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55478->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55488->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55496->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55524->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55546->127.0.0.1:5201: write: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:55644->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55688->127.0.0.1:5201: write: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:55730->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55748->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55758->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55756->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55786->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55826->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55856->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55882->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55884->127.0.0.1:5201: write: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:55892->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55906->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55992->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:55998->127.0.0.1:5201: write: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:56030->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56110->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56118->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56136->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56144->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56156->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56186->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56204->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56242->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56336->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56332->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56518->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56538->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56580->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56610->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56730->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56656->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56640->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56818->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56834->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56832->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56838->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:56878->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57028->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57036->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57054->127.0.0.1:5201: write: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:57088->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57308->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57216->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57304->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 dial tcp 127.0.0.1:5201: connect: connection reset by peer
2019/05/10 11:44:42 write tcp 127.0.0.1:57348->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57218->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57346->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:42 write tcp 127.0.0.1:57226->127.0.0.1:5201: write: broken pipe
2019/05/10 11:44:52 dial tcp 127.0.0.1:5201: i/o timeout
2019/05/10 11:45:04 dial tcp 127.0.0.1:5201: i/o timeout

Possible Solution

Set password on each port

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version:
  • Server Operating System:
  • Server Operating System Version:
  • Server Operation System Language:
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Set password on each port, and only accept this ports.

$ mr2 server -l :9999 --portPassword '1000 password' --portPassword '2000 password'

Current Behavior

Client connect to server any port with same password

$ mr2 server -l :9999 -p password

Detailed Description

Possible Solution

compat MIPS32 without FPU

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: v20190506
  • Server Operating System: Ubuntu
  • Server Operating System Version: 18.04
  • Server Operation System Language:
  • Client Operating System: LEDE
  • Client Operating System Version: 17.01.X
  • Client Operation System Language:

Expected Behavior

Work on MIPS(ar71xx) without FPU

Current Behavior

Not Working

Detailed Description

Possible Solution

Build with args: GOMIPS=softfloat

Docker Container

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Possible Solution

Would be great if you could provide a docker container on the docker hub for this

The version of mr2 20191224 can't run. It says "flag provided but not defined: -P"

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: 20191224
  • Server Operating System: CentOS 8
  • Server Operating System Version: CentOS 8.0.1905 amd64
  • Server Operation System Language: en_US
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Running without error.

Current Behavior

After run the command mr2 server -l :9999 -P '5678 password' -P '6789 password1', it says 2019/12/25 01:23:15 flag provided but not defined: -P

Steps to Reproduce

  1. On the server to run the command mr2 server -l :9999 -P '5678 password' -P '6789 password1

Detailed Description

Possible Solution

Mr

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version:
  • Server Operating System:
  • Server Operating System Version:
  • Server Operation System Language:
  • Client Operating System:
  • Client Operating System Version:
  • Client Operation System Language:

Expected Behavior

Current Behavior

Detailed Description

Possible Solution

Enable static build by default

Prerequisites

  • Did you search in issues?
  • Are you running the latest version?
  • I will write this according to this template.

Environment

  • Mr.2 Version: v20190506
  • Server Operating System: Ubuntu
  • Server Operating System Version: 18.04
  • Server Operation System Language:
  • Client Operating System: LEDE
  • Client Operating System Version: 17.01.X
  • Client Operation System Language:

Expected Behavior

work on non-glibc env

Current Behavior

failed

Detailed Description

# ldd mr2
	linux-vdso.so.1 (0x00007ffed99d8000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd2932c5000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd292ed4000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd2934e4000)

pre-built binary for amd64 is dynamic-linked, cant run in musl env, sush as archlinux, alpine, openwrt

Possible Solution

Enable static build by default

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.