Gogrok is a self hosted, easy to use alternative to ngrok. It uses SSH as a base protocol, using channels and existing functionality to tunnel requests to an endpoint.

gogrok

Build Status

A simple, easy to use ngrok alternative (self hosted!)

The server and client can also be easily embedded into your applications, see the 'server' and 'client' directories.

Features

  • HTTP and HTTPS handling
  • Public key authentication
  • Authorized key whitelists
  • Registration of reserved hosts
  • Forwarding system that allows easy additions of other protocols (Coming soon: TCP and TCP+TLS, with host-based TLS support)

Example usage

By default, the first time you run gogrok it'll generate both a server and a client certificate. These will be stored in ~/.gogrok, but can be overridden with the gogrok.storageDir option (or GOGROK_STORAGE_DIR environment variable)

Server:

gogrok serve

Client:

gogrok --server=localhost:2222 http://localhost:3000

Server

$ ./gogrok serve --help
Start the gogrok server

Usage:
  gogrok serve [flags]

Flags:
      --bind string       SSH Server Bind Address (default ":2222")
      --domains strings   Domains to use for
  -h, --help              help for serve
      --http string       HTTP Server Bind Address (default ":8080")
      --keys string       Authorized keys file to control access

Global Flags:
      --config string   config file (default is $HOME/.gogrok.yaml)
      --viper           use Viper for configuration (default true)

Client

$ ./gogrok client --help
Start the gogrok client

Usage:
  gogrok client [flags]

Flags:
  -h, --help                help for client
      --key string          Client key file
      --passphrase string   Client key passphrase
      --server string       Gogrok Server Address (default "localhost:2222")

Global Flags:
      --config string   config file (default is $HOME/.gogrok.yaml)
      --viper           use Viper for configuration (default true)

Docker

Example docker compose file. Caddy is suggested as a frontend using dns via cloudflare and DNS-01 for wildcards.

version: '3.7'

services:
  gogrok:
    image: tystuyfzand/gogrok:latest
    ports:
    - 2222:2222
    - 8080:8080
    volumes:
    - /docker/gogrok/config:/config
    environment:
    - GOGROK_DOMAINS=gogrok.ccatss.dev
    - GOGROK_AUTHORIZED_KEY_FILE=/config/authorized_keys

Host Registration

Gogrok lets you register your own custom hosts that are attached to your public key.

On the server, make sure to run the server with the flag --store=PATH_TO_DB.db

Use gogrok register and gogrok unregister to manage registered hosts to your client key.

Owner
Tyler Stuyfzand
Just someone who likes to create simple and easy to use packages, Discord bots, and many other things. Any opinions and code on here are my own.
Tyler Stuyfzand
Similar Resources

Inspired by go-socks5,This package provides full functionality of socks5 protocol.

Inspired by go-socks5,This package provides full functionality of socks5 protocol.

The protocol described here is designed to provide a framework for client-server applications in both the TCP and UDP domains to conveniently and securely use the services of a network firewall.

Dec 16, 2022

Diameter stack and Base Protocol (RFC 6733) for the Go programming language

Diameter Base Protocol Package go-diameter is an implementation of the Diameter Base Protocol RFC 6733 and a stack for the Go programming language. St

Dec 28, 2022

A base library defines interfaces and modules of aBFT Lachesis consensus protocol

Lachesis base A base library defines interfaces and modules of aBFT Lachesis consensus protocol. Part of galaxy' s Consensus-as-a-Service for distribu

Oct 25, 2021

Golang `net/rpc` over SSH using installed SSH program

Golang net/rpc over SSH using installed SSH program This package implements a helper functions to launch an RPC client and server. It uses the install

Nov 16, 2022

Self-hostable , easy-to-use , lightweight and feature-rich torrent client written in Go

Self-hostable , easy-to-use , lightweight and feature-rich torrent client written in Go

Self-hostable , easy-to-use , lightweight and feature-rich torrent client written in Go . It comes with beautiful Web UI and Optional Multi-User Support . Run Locally or Host in Server . Open/Download/Stream Torrents in Browser Right Away!

Jan 1, 2023

The fastest way to create self-hosted exit-servers

The fastest way to create self-hosted exit-servers

inletsctl - the fastest way to create self-hosted exit-servers inletsctl automates the task of creating an exit-server (tunnel server) on public cloud

Dec 15, 2022

Headscale - An open source, self-hosted implementation of the Tailscale control server

Headscale - An open source, self-hosted implementation of the Tailscale control server

Dec 29, 2022

☁️ Cloud Torrent: a self-hosted remote torrent client

☁️ Cloud Torrent: a self-hosted remote torrent client

Cloud torrent is a a self-hosted remote torrent client, written in Go (golang). You start torrents remotely, which are downloaded as sets of files on

Jan 6, 2023

Self-hosted reverse-proxy for F1 web viewer.

Self-hosted reverse-proxy for F1 web viewer.

F1WebViewer-SelfHosted Self-hosted reverse-proxy for F1 web viewer and includes a web server at port 13331. You can also run this proxy on a server if

Dec 21, 2022
Comments
  • gogrok client --key doesn't exist

    gogrok client --key doesn't exist

    Hi,

    Trying to use my own instance of gogrok server but i encount an issue:

    gogrok-gogrok_client-1  | Error: unknown flag: --key
    gogrok-gogrok_client-1  | Usage:
    gogrok-gogrok_client-1  |   gogrok client [flags]
    gogrok-gogrok_client-1  |
    gogrok-gogrok_client-1  | Flags:
    gogrok-gogrok_client-1  |   -h, --help            help for client
    gogrok-gogrok_client-1  |       --host string     Requested host to register
    gogrok-gogrok_client-1  |       --server string   Gogrok Server Address (default "localhost:2222")       
    gogrok-gogrok_client-1  |
    gogrok-gogrok_client-1  | Global Flags:
    gogrok-gogrok_client-1  |       --config string   config file (default is $HOME/.gogrok.yaml)
    gogrok-gogrok_client-1  |       --viper           use Viper for configuration (default true)
    gogrok-gogrok_client-1  |
    gogrok-gogrok_client-1  | unknown flag: --key
    

    but on the readme.md there is --key arg on client section.

    I just looking for ssh authentication between client and server instances

  • can we have an example of gorok.yaml in config folder?

    can we have an example of gorok.yaml in config folder?

    Hi,

    Thanks for this project! It looks like what i'm looking for.

    I try to use it in docker containers. I just need an example of gorok.yaml config file to configure the server instance.

    Could you provide it please?

Related tags
Go HTTP tunnel is a reverse tunnel based on HTTP/2.

Go HTTP tunnel is a reverse tunnel based on HTTP/2. It enables you to share your localhost when you don't have a public IP.

Dec 28, 2022
GO Simple Tunnel - a simple tunnel written in golang
GO Simple Tunnel - a simple tunnel written in golang

GO Simple Tunnel GO语言实现的安全隧道 English README !!!V3版本已经可用,欢迎抢先体验!!! 特性 多端口监听 可设置转发代理,支持多级转发(代理链) 支持标准HTTP/HTTPS/HTTP2/SOCKS4(A)/SOCKS5代理协议 Web代理支持探测防御 支

Jan 2, 2023
A server that proxies requests and uses fhttp & my fork of CycleTLS to modify your clienthello and prevent your requests from being fingerprinted.

TLS-Fingerprint-API A server that proxies requests and uses my fork of CycleTLS & fhttp (fork of net/http) to prevent your requests from being fingerp

Jan 7, 2023
Simple HTTP tunnel using SSH remote port forwarding

Simple HTTP tunnel using SSH remote port forwarding

Nov 18, 2022
Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router
Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router

Self-hosted and Easy-to-deploy Cloudflare based Dynamic DNS service for router Contents Features Environment Variables Installation Heroku Docker (Run

Oct 9, 2022
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH.
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH.

Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. Single executable including both client and server. Written in Go (golang). Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.

Jan 1, 2023
This is a tool that will proxy simple HTTPS requests to an external HTTP endpoint
 This is a tool that will proxy simple HTTPS requests to an external HTTP endpoint

AcmeShield A secured HTTP proxy that forwards requests from a remote service(Postman). This is a tool that will proxy simple HTTPS requests to an exte

Mar 21, 2022
ngrok : Introspected tunnels to localhost
ngrok : Introspected tunnels to localhost

ngrok - Introspected tunnels to localhost (homepage) ”I want to expose a local server behind a NAT or firewall to the internet.” What is ngrok? ngrok

Oct 27, 2021
This is a fork version from ngrok
This is a fork version from ngrok

Because the original version is no longer maintained, So I forked that project and made the following changes: split

Nov 14, 2022
wire protocol for multiplexing connections or streams into a single connection, based on a subset of the SSH Connection Protocol

qmux qmux is a wire protocol for multiplexing connections or streams into a single connection. It is based on the SSH Connection Protocol, which is th

Dec 26, 2022