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

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

Similar Resources

A fast, high performance Cross-platform lightweight Nat Tracker Server,

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

Apr 15, 2022

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

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

Feb 11, 2022

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

Dec 19, 2021

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

Nov 17, 2022

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

Dec 30, 2022

Port-proxy - Temporary expose port for remote connections

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

Jan 27, 2022

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

Dec 29, 2022

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

Nov 9, 2022

Reverse proxy server to filter traffic based on JA3 fingerprint/hash

JA3RP (JA3 Reverse Proxy) Ja3RP is a basic reverse proxy server that filters traffic based on JA3 fingerprints. It can also operate as a regular HTTP

Sep 17, 2022
Related tags
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 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

Jan 1, 2023
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

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

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

Oct 17, 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! +---------------------

Jun 29, 2022
Internet connectivity for your VPC-attached Lambda functions without a NAT Gateway
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

Nov 9, 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

Jan 2, 2022
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

Jan 22, 2022