gabihodoroaga / porth

A simple secure port redirector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

porth

A simple secure tcp port redirector.

The idea is simple:

Let’s say you want to access the database of a client from your laptop and you don’t have access to the client’s router/firewall and also you are in a network where you cannot control the router/firewall. One option would be if the client connects to an external server and you connect to the same server and also tell the server to transfer the packets from one connection to another. Using porth you can achieve this.

Alt text

Features

  • use client certificates
  • use one server port for all clients and operators
  • connect multiple operators to one client

Build

Certificates

The certificates can be regenerated by running the following command.

cd ./tools
./keys.sh

Binaries

# build server
cd ./server
go build
    
# build client
cd ./client
go build
 
# build operator
cd ./operator
go build

Use

Start the server on default port 2671.

./server/server

Redirect port 7000 on client host.

./client/client -server=localhost:2671 -local=localhost:7000 -id=testid

Redirect port 7001 on operator host using the same id.

./operator/operator -server=localhost:2671 -local=:7001 -id=testid

Now the client port 7000 is accessible from operator host on port 7001.

Server status is available on port 2672.

curl -i http://localhost:2672/clients
curl -i http://localhost:2672/server_status

About

A simple secure port redirector

License:MIT License


Languages

Language:Go 92.2%Language:Shell 7.8%