Git Product home page Git Product logo

tcprelay's Introduction

tcprelay

tcprelay helps client accessing the host unreachable. For example:

  • Virtual machine vm1 runing on server A, with NAT ip 192.168.122.*.
  • Server A has public IP 192.168.1.10.
  • Client can access server A, but can not access tcp port 80 of vm1 directly.
  • With tcprelay running on server A.
  • Client can access tcp port 80 of vm1 directly by 192.168.1.10:8080.

Figure

Client A can not direct access target machine, for some reason firewall or NAT etc.
The other middle machine can access target. Tcp client can access target with tcp by tcprelay running on middle machine.

                                             +----------------+
                                             |                |
        +------------------------------->    |     target     |(vm1)
        |     can not direct access          |                |
        |                                    +----------------+
        |                                             ^  192.168.122.*:80
        |                                             |
        |                                             | 
        |                                             |  192.168.122.1
+--------------+                             +----------------+
|              | 192.168.1.20                |                |
|   client A   | +------------------------>  |     server A   |(tcprelay)
|              |           192.168.1.10:8080 |                |
+--------------+                             +----------------+

how to run

on server A, run tcprelay.

./tcprelay -l ":8080"  -t "192.168.122.101:80"

It will listen on 8080, and all the client connected to :8080 will be relay to 192.168.1.101:80

For the client, just type http://1.2.3.4:8080 you can access the web service on target machine.

how to build

download this code, cd into the dir. type command as follows:

SET GOOS=linux
SET GOARCH=amd64
SET GOPROXY=https://goproxy.cn
go build .

download

if you don't want to compile it. just download in release page.
It's very easy to use.

reference

This program is taken from this two repository. they are the hero.

https://github.com/xtaci/kcptun
https://github.com/hikaricai/p2p_tun

powerful another port mapping tool

gost is a powerful relay tool.
https://github.com/ginuerzh/gost
It's easy to use, like this.

./gost -L  tcp://:8080/192.168.122.101:80  

tcprelay's People

Contributors

alongl avatar

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.