4chain is a simple、fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet.

Related tags

Network edge
Overview

4Chain

What is 4chain?

4chain is a simple、fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet.

Using the ssh protocol means that Linux, macOS can quickly connect using the ssh command, and windows can connect using ?

                                               Request                                                                                      
                            ┌───────────────dispatch: foo───────────┐                                                                       
                            │                                       │                                                                       
                            │                                       │                                                                       
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼ ─ ─ ─ ─                      ┌ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─                                            
              Host Node     │        │                              │    Exit Node              │                                           
│                           ▼                              │        │                                                                       
   ┌───────────┐       ┌────────┐    │      .─────.            ┌────────┐        ┌──────────────┴────────┐        .─────.        ┌─────────┐
│  │   Node    │       │        │          ╱       ╲       │   │        │        │                       │       ╱       ╲       │         │
   │http://127.│◀ ─ ─ ▶│ client │◀═══╬═══▶(   SSH   )◀════════▶│ Server │◀ ─ ─ ─▶│http(s)://foo.4chain.me│◀ ─ ─▶(internet )◀─ ─ ▶│ Browser │
│  │0.0.1:3000 │       │        │          `.     ,'       │   │        │        │                       │       `.     ,'       │         │
   └───────────┘       └────────┘    │       `───'             └────────┘        └──────────────┬────────┘         `───'         └─────────┘
│                           │                              │        ▲                                                                       
     Private IPv4           │        │                              │                           │                                           
│                           │                              │        │                                                                       
 ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ┘                      ─ ─ ─ ─ ┼ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘                                           
                            │             Response                  │                                                                       
                            └────────────────OK─────────────────────┘                                                                       
                                                                                                                                                   

Feature

Quick start

  1. map the local listening port 8082 to the public network via 4chain.me
$ ssh -R 443::8082 4chain.me
  1. After establishing a successful remote SSH connection, the public access URL is returned https://0u6rq7.4chain.me

  2. Access from the public network

    curl https://0u6rq7.4chain.me

Deploy

Preparation:

  • domain name 4chain.me
  • server IP 157.xxx.xx.xx
{
  "addr": ":443",
  "email": "[email protected]",
  "cf_token": "xxx",
  "ssh_addr": ":22",
  "domain": "4chain.me", # change you domain
  "idle_timeout": 300,
  "key": "-----BEGIN OPENSSH PRIVATE KEY-----\nxxxxxx\n-----END OPENSSH PRIVATE KEY-----\n"
}
  1. Configure cloudflare dns resolution
    A 4chain.me 157.xxx.xx.xx
    A *.4chain.me 157.xxx.xx.xx
  1. Get cloudflare token to the cf_token field of config.json

  2. generator ssh key:

$ ssh-keygen -b 2048 -f 4chain_rsa
$ cat 4chain_rsa #Copy the contents of the generated private key to the key field of config.json 
  1. start 4chain
#.
#├── 4chain
#└── config.json
#

$  ./4chain

TODO

  • Support windows

Developer

License

BSD

Other

Deepl

You might also like...
Go-http-sleep: Delayed response http server, useful for testing various timeout issue for application running behind proxy

delayed response http server, useful for testing various timeout issue for application running behind proxy

Resolved the issue that Windows cannot detect the Internet even if it does have an Internet connection.

win-connect 中文文档 Background This program is built to resolved the issue that Windows cannot detect the Internet even if it does have an Internet conne

Battlesnake-logging-proxy - A little proxy between the internet and your battlesnake

battlesnake-logging-proxy a little proxy between the internet and your battlesna

mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together

mt-multiserver-proxy mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together. It is the successor to multiserv

A TCP proxy used to expose services onto a tailscale network without root. Ideal for container environments.

tailscale-sidecar This is barely tested software, I don't guarantee it works but please make an issue if you use it and find a bug. Pull requests are

Port-proxy - Temporary expose port for remote connections

Port proxy util Temporary expose port for remote connections. E.g. database/wind

Simple edge server / reverse proxy

reproxy Reproxy is simple edge HTTP(s) sever / reverse proxy supporting various providers (docker, static, file). One or more providers supply informa

TProx is a fast reverse proxy path traversal detector and directory bruteforcer.
TProx is a fast reverse proxy path traversal detector and directory bruteforcer.

TProx is a fast reverse proxy path traversal detector and directory bruteforcer Install • Usage • Examples • Join Discord Install Options From Source

NAT puncher for Wireguard mesh networking.

natpunch-go This is a NAT hole punching tool designed for creating Wireguard mesh networks. It was inspired by Tailscale and informed by this example.

Owner
null
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.

rconn (r[everse] conn[ection]) is a multiplatform program for creating reverse connections. It lets you consume services that are behind NAT and/or fi

Hikmat Jafarli 233 Sep 4, 2022
Curtis Milo 2 May 8, 2022
A http-relay server/client written in golang to forward requests to a service behind a nat router from web

http-relay This repo is WIP http-relay is a server/client application written in go(lang) to forward http(s) requests to an application behind a nat r

john dev 1 Dec 16, 2021
netstat-nat - Display NAT entries on Linux systems

netstat-nat This is a reimplementation of the netstat-nat tool, written entirely in Go. It uses the same command line flags and almost the same output

Dominik Honnef 17 Oct 26, 2021
Create a dynamic fou tunnels works behind NAT

Dynamic Linux Tunneling This software creates Gretap Tunnels over FOU for Dynamic client endpoints. It also works behind NAT444 (CGN-LSN). You can use

Ahmet ÖZER 4 Jun 5, 2022
Internet connectivity for your VPC-attached Lambda functions without a NAT Gateway

lambdaeip Internet connectivity for your VPC-attached Lambda functions without a NAT Gateway Background I occasionally have serverless applications th

Glass Echidna 23 Aug 3, 2022
“Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server!

Dear Port80 About The Project: “Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server! +---------------------

Abbas Gheydi 6 Jun 29, 2022
A fast, high performance Cross-platform lightweight Nat Tracker Server,

NatTrackerServer A fast, high performance Cross-platform lightweight Nat Tracker Server suport IPv4 and IPv6 Tracker Server protocol 1、get NAT public

51pwn 2 Apr 15, 2022
Tcp-proxy - A dead simple reverse proxy server.

tcp-proxy A proxy that forwords from a host to another. Building go build -ldflags="-X 'main.Version=$(git describe --tags $(git rev-list --tags --max

Injamul Mohammad Mollah 0 Jan 2, 2022