Skip to content
YaronKoreshPublic

About

A secure, pure-Python HTTP tunnel to expose local services to the internet.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🌉 Gesher

Gesher (Hebrew for "Bridge") is a secure, self-hosted, pure-Python HTTP tunneling system. It allows you to expose local web servers to the internet or a private network without opening ports or configuring firewalls. Built with a "Security-First" philosophy, Gesher ensures your data is protected by multiple layers of encryption and authorization.


Key Features

  • End-to-End Encryption: All traffic between the Client and Server is encrypted using Fernet (AES-128-CBC + HMAC-SHA256). Even if SSL is stripped, the payload remains "gibberish" to attackers.
  • HMAC-SHA256 Signatures: Prevents unauthorized command injection; the secret is never sent over the wire.
  • Replay Protection: Blocks captured request replays by tracking signatures within a time-window.
  • Gatekeeper PIN: A session-specific code required to join the network, serving as a 2FA layer for your tunnel.
  • Load Balancing: Connect multiple clients to a single server to create a high-availability cluster using Round-Robin distribution.
  • Local-First Monitoring: A real-time dashboard that runs only on your local machine, fetching encrypted stats from the server for maximum privacy.
  • One-Click Public URL: Integrated cloudflared support to instantly generate a public HTTPS URL on Windows, macOS, or Linux.

Installation

Prerequisites

  • Python 3.8+

Install from Source

git clone https://github.com/YaronKoresh/gesher.git
cd gesher
pip install .

Quick Start

1. Start the Bridge Server

Run this on your public-facing machine (e.g., a VPS or a cloud instance).

gesher server --port 8000 --secret "your-long-secret-key"

Output:

🌉 Gesher Secure Server
--------------------------------
📍 Port:       8000
🛡️  PIN:        7A9F2B
📊 Dashboard:  Run 'gesher client' to view local stats.
--------------------------------

Note the PIN (7A9F2B). You will need this to connect your clients.

2. Start the Local Connector (Client)

Run this on your local machine where your web app (e.g., localhost:3000) is running.

gesher client \
  --gateway http://<server-ip>:8000 \
  --secret "your-long-secret-key" \
  --pin 7A9F2B \
  --target http://localhost:3000

3. Access the Dashboard

Open your browser to http://localhost:9000 (the default dashboard-port). You will see live traffic stats and the status of all connected peers in your private bridge.


Command Line Options

Run gesher --version to print the installed version.

Server Mode

Flag Description Default
--secret The shared encryption/auth secret. Required
--port Port to listen on for public requests. 8000
--public Automatically start a Cloudflare tunnel for a public URL. False

On Linux the cloudflared package is installed with dpkg (through sudo, unless you run as root); on systems without dpkg, install cloudflared by hand first.

Stopping the server with Ctrl+C or with SIGTERM also stops the cloudflared process it started.

Client Mode

Argument/Flag Description Default
--gateway The URL of your remote Gesher server. Required
--secret The shared encryption/auth secret. Required
--pin The session PIN shown on the server console. Required
--target Your local service URL (where traffic is sent). http://localhost:8080
--dashboard-port Port to host the local-only monitor UI. 9000

Project Structure

  • gesher/server.py: The "Dark Server" that manages tunnels and load balancing.
  • gesher/client.py: The connector that executes local requests and hosts the UI.
  • gesher/security.py: The core cryptographic engine handling AES and HMAC.
  • gesher/cli.py: The entry point and automation for cloudflared installation.

License

This project is released under the GNU General Public License v3.0 license. Please read the LICENSE.

About

A secure, pure-Python HTTP tunnel to expose local services to the internet.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages