Skip to content

gTunnel is a fast, lightweight tunneling solution written in Go that allows you to expose local services to the internet through a secure tunnel

License

Notifications You must be signed in to change notification settings

B-AJ-Amar/gTunnel

Repository files navigation

gTunnel

gTunnel is a fast, lightweight tunneling solution written in Go that allows you to expose local services to the internet through a secure tunnel. Similar to ngrok or VSCode Port-Forwarding, GTunnel provides a simple way to share your local development server with the world.

License Go Version Release

✨ Features

  • 🚀 Fast & Lightweight - Written in Go for optimal performance
  • 🔒 Secure - Token-based authentication and HTTPS/WSS support
  • 🌐 Cross-Platform - Works on Windows, macOS, and Linux
  • 🐳 Docker Ready - Pre-built Docker images for easy deployment
  • 📦 Easy Installation - Multiple installation methods (binaries, packages, Docker)
  • Zero Configuration - Works out of the box with sensible defaults
  • 🔧 Flexible - CLI tools for both client and server management

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Local App     │    │  gTunnel Client │    │  gTunnel Server │
│ localhost:3000  │◄──►│      (gtc)      │◄──►│      (gts)      │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                                       ▲
                                                       │
                                               ┌───────▼───────┐
                                               │  Public URL   │
                                               │ tunnel.me:443 │
                                               └───────────────┘

📋 Table of Contents

🚀 Quick Start

1. Install the Client

Download from releases:

# Linux/macOS
curl -L https://github.com/B-AJ-Amar/gTunnel/releases/latest/download/gtunnel-client_linux_amd64.tar.gz | tar -xz
sudo mv gtc /usr/local/bin/

# Or use our installation script (supports client, server, or both)
curl -sSL https://raw.githubusercontent.com/B-AJ-Amar/gTunnel/main/scripts/install.sh | bash

# Install server only
curl -sSL https://raw.githubusercontent.com/B-AJ-Amar/gTunnel/main/scripts/install.sh | bash -s server

# Install both client and server
curl -sSL https://raw.githubusercontent.com/B-AJ-Amar/gTunnel/main/scripts/install.sh | bash -s both

2. Connect to Public Server

# Expose your local port 3000
# https://gtunnel-server-1i1b.onrender.com is the default server for the version v0.0.0
gtc connect -u https://gtunnel-server-1i1b.onrender.com -e /my-app 3000

# Your app is now available at: https://gtunnel-server-1i1b.onrender.com/my-app

3. Deploy Your Own Server (Optional)

Deploy to Render

📦 Installation

Quick Installation

# Install client (recommended for most users)
curl -sSL https://raw.githubusercontent.com/B-AJ-Amar/gTunnel/main/scripts/install.sh | bash

# Install server for self-hosting
curl -sSL https://raw.githubusercontent.com/B-AJ-Amar/gTunnel/main/scripts/install.sh | bash -s server

Alternative Methods

📖 For detailed installation instructions, see our Installation Guide

📖 Usage

Basic Client Usage

# Connect to public server (replace with your server URL)
gtc connect -u https://gtunnel-server-1i1b.onrender.com -e /my-app 3000

# Your app is now available at: https://gtunnel-server-1i1b.onrender.com/my-app

Server Usage

# Start your own server
gts start --bind-address 0.0.0.0:7205

📖 For complete usage examples and configuration, see our Documentation

🌐 Deployment

Quick Deploy (Recommended)

Deploy to Render

Deploy your own gTunnel server with one click - includes free HTTPS, automatic SSL, and health monitoring.

📖 For self-hosted options and advanced deployment, see our Deployment Guide

📚 Documentation

Our comprehensive documentation covers everything you need:

Visit Documentation Site for the complete guide.

🧪 Development

Development Setup

# Clone repository
git clone https://github.com/B-AJ-Amar/gTunnel.git
cd gTunnel

# Install dependencies
go mod download

# Run tests
make test

# Build for development
make build-dev

# Build with version info
make VERSION=dev build

Available Make Targets

Command Description
make build Build both client and server with version info
make build-client Build only the client
make build-server Build only the server
make build-dev Build without version info
make install Install binaries to GOPATH/bin
make test Run all tests
make clean Clean build directory
make release Create a release with GoReleaser
make help Show all available targets

Project Structure

gTunnel/
├── cmd/
│   ├── client/              # Client CLI application
│   └── server/              # Server CLI application
├── internal/
│   ├── client/              # Client-side logic
│   ├── server/              # Server-side logic
│   ├── protocol/            # Shared protocol definitions
│   ├── logger/              # Logging utilities
│   └── version/             # Version information
├── scripts/                 # Build and deployment scripts
├── docs/                    # Documentation
├── Dockerfile.server        # Server Docker image
├── render.yaml              # Render deployment config
├── .goreleaser.yml          # Release configuration
└── Makefile                 # Build automation

🤝 Contributing

We welcome contributions! Here's how you can help:

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: make test
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Guidelines

  • Go style: Follow Go conventions and use gofmt
  • Tests: Add tests for new features
  • Documentation: Update README and code comments
  • Commits: Use clear, descriptive commit messages

Roadmap

  • Basic tunneling - HTTP/HTTPS tunneling through WebSocket
  • Authentication - Token-based authentication (basic)
  • CLI tools - Complete command-line interface
  • Docker support - Pre-built Docker images
  • Multi-platform - Windows, macOS, and Linux support
  • WebSocket support - Native WebSocket tunneling for real-time applications
  • Multiple tunnels - Multiple tunnels per client
  • Multicasting - Broadcast same message to multiple clients (for webhooks)
  • Advanced client management - Profiles, advanced auth, permissions ...
  • VS Code extension - Integrated tunneling directly in VS Code
  • Documentation site - Comprehensive docs with Docusaurus
  • Admin dashboard - Web interface for server management
  • Request queuing - Queue requests for offline clients
  • .gtunnel config file - Project-specific config file for easier connection management
  • Subdomain routing - Custom subdomains for tunnels

📄 License

This project is licensed under the Apache-2.0 license - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ by @B-AJ-Amar

About

gTunnel is a fast, lightweight tunneling solution written in Go that allows you to expose local services to the internet through a secure tunnel

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published