Clippy/Fmt Tests Coverage Status

Overview

An implementation of HTTP Tunnel in Rust.

The core code is entirely abstract from the tunnel protocol or transport protocols. In this example, it supports both HTTP and HTTPS with minimal additional code.

It can run over QUIC+HTTP/3 or connect via another tunnel (as long as AsyncRead + AsyncWrite is satisfied for the implementation).

Quick overview of source files

Run demo

There are two modes.

Testing with a browser (HTTP)

In Firefox, you can set the HTTP proxy to localhost:8080. Make sure you run it with the right configuration:

https://support.mozilla.org/en-US/kb/connection-settings-firefox

(use HTTP Proxy and check "use this proxy for FTP and HTTPS")

$ ./target/release/http-tunnel --config ./config/config-browser.yaml --bind 0.0.0.0:8080 http

Testing with cURL (HTTPS)

This proxy can be tested with cURL:

Add simple.rust-proxy.org' to /etc/hosts: $ echo '127.0.0.1 simple.rust-http-tunnel.org' | sudo tee -a /etc/hosts

Then try access-listed destinations (see ./config/config.yaml), e.g:

curl -vp --proxy https://simple.rust-http-tunnel.org:8443 --proxy-cacert ./config/domain.crt https://www.wikipedia.org

You can also play around with destinations that are not allowed.

Privacy

The application cannot see the plaintext data.

The application doesn't log any information that may help identify clients (such as IP, auth tokens). Only general information (events, errors, data sizes) is logged for monitoring purposes.

DDoS protection

Some of them can be solved by introducing rate/age limits and inactivity timeouts.