REPROX
REPROX is a reverse proxy for http and tcp, insipired from
JPRQ
you can expose your home / private network to the public, share your local
website to the world
you can self hosted the server app using your own domain
more detail here
Requirement
- domain or get a free domain here
- vps / server with public ip
- domain TLS certificates or you can generate free
letsencrypt certificate
- disable server firewall
- make server can accept tcp traffic from all port
How to use
Preparation
- if you are using linux you can add to
/etc/environment
file
- or just in terminal run export ...
this is a required environment variables
example :
export DOMAIN=labstack.myaddr.io
export DOMAIN_EVENT=labstack.myaddr.io:4321
this is an optional environment variable
example :
export HTTP_PORT=80
export HTTPS_PORT=443
export TLS_PATH_CERT="/home/ubuntu/letsencrypt/certs/live/labstack.myaddr.io/fullchain.pem"
export TLS_PATH_KEY="/home/ubuntu/letsencrypt/certs/live/labstack.myaddr.io/privkey.pem"
if you dont specified port the default value will be used
if you dont specified tls file the https will be disabled automatically
Compile Server App
./build.server.sh
check bin folder and choose the correct binary according to your arch
file is prefix with server-
Compile Client App
./build.client.sh
check bin folder and choose the correct binary according to your arch
file is prefix with client-
Notes
- every time the environment is changed, you need to recompile both apps
Server App Usage
before using server app make sure the required environment variables is exported
replace arch with this
arch |
description |
linux-386 |
linux 32bit |
linux-amd64 |
linux 64bit |
linux-arm |
linux arm 32bit |
linux-arm64 |
linux arm 64bit |
windows-386 |
windows 32bit |
windows-amd64 |
windows 64bit |
darwin-amd64 |
mac with intel chip |
darwin-arm64 |
mac with arm chip |
./bin/server-{arch}
Client App Usage
before using client app make sure the required environment variables is exported
replace arch with this
arch |
description |
linux-386 |
linux 32bit |
linux-amd64 |
linux 64bit |
linux-arm |
linux arm 32bit |
linux-arm64 |
linux arm 64bit |
windows-386 |
windows 32bit |
windows-amd64 |
windows 64bit |
darwin-amd64 |
mac with intel chip |
darwin-arm64 |
mac with arm chip |
command :
./bin/client-{arch} option
option |
description |
-p |
local port |
-s |
subdomain |
-cname |
different domain using CNAME |
--dir |
directory path |
For exposing any HTTP servers
./bin/client-{arch} http -p 3000 -s subdomain
For exposing any TCP servers, such as SSH
./bin/client-{arch} tcp -p 22 -s subdomain
Exposing on a different domain
./bin/client-{arch} http -p 3000 -cname example.com
Exposing directory static files using built-in HTTP Server
./bin/client-{arch} serve --dir . -s subdomain
Press Ctrl+C to stop
Docker Image
docker run --rm --network host -d jhonoryza/reprox:linux-amd64
Security
If you discover any security related issues, please create an issue.
License
The MIT License (MIT). Please see License File for more
information.