All Projects → xnuter → http-tunnel

xnuter / http-tunnel

Licence: other
HTTP(S) Tunnel and TCP Proxy

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to http-tunnel

Goproxy
🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
Stars: ✭ 11,334 (+16091.43%)
Mutual labels:  http-proxy, tcp-proxy
FastTunnel
expose a local server to the internet. 高性能跨平台的内网穿透解决方案 远程内网计算机 域名访问内网站点 反向代理内网服务 端口转发 http代理
Stars: ✭ 815 (+1064.29%)
Mutual labels:  http-proxy, tcp-proxy
HttpFilteringEngine
Transparent filtering TLS proxy.
Stars: ✭ 48 (-31.43%)
Mutual labels:  http-proxy
ssltun
simple secure http proxy server with automic https
Stars: ✭ 33 (-52.86%)
Mutual labels:  http-proxy
poseidon-medusa
HTTP proxy module based on Poseidon
Stars: ✭ 15 (-78.57%)
Mutual labels:  http-proxy
rlb
Redirecting Load Balancer
Stars: ✭ 30 (-57.14%)
Mutual labels:  http-proxy
swish
C++ HTTP requests for humans
Stars: ✭ 52 (-25.71%)
Mutual labels:  http-proxy
ProxyPoolWithUI
Python编写的HTTP代理池,集成WEB管理界面,无外部数据库依赖,可直接运行,兼容Windows,Linux和macOS。Free Proxy Pool with Web UI on Windows, Linux, and macOS.
Stars: ✭ 100 (+42.86%)
Mutual labels:  http-proxy
userscript-proxy
HTTP proxy to inject scripts and stylesheets into existing sites.
Stars: ✭ 66 (-5.71%)
Mutual labels:  http-proxy
foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 61 (-12.86%)
Mutual labels:  http-proxy
taosocks
A smart tunnel proxy that helps you bypass firewalls.
Stars: ✭ 26 (-62.86%)
Mutual labels:  http-proxy
hyper-reverse-proxy
A simple reverse proxy for use with Hyper and Tokio
Stars: ✭ 94 (+34.29%)
Mutual labels:  http-proxy
cute-proxy
A Man-In-The-Middle Proxy as Fiddle and Charles, using Netty, JavaFX
Stars: ✭ 62 (-11.43%)
Mutual labels:  http-proxy
Mirror
Deploy Google and Wikipedia mirror with one command using now.sh.
Stars: ✭ 93 (+32.86%)
Mutual labels:  http-proxy
FullProxy
Bind and reverse connection based, SOCKS5, HTTP and PortForward based portable proxy
Stars: ✭ 22 (-68.57%)
Mutual labels:  http-proxy
cnn-proxy
Subdomain method that proxies websockets, XMLHttpRequests, and more.
Stars: ✭ 13 (-81.43%)
Mutual labels:  http-proxy
Pummel
Socks5 Proxy HTTP/HTTPS-Flooding (cc) attack
Stars: ✭ 53 (-24.29%)
Mutual labels:  http-proxy
http proxy
http proxy with Elixir. wait request with multi port and forward to each URIs
Stars: ✭ 55 (-21.43%)
Mutual labels:  http-proxy
proxy-list
A curated list of free public proxy servers
Stars: ✭ 70 (+0%)
Mutual labels:  http-proxy
fastify-gateway
A Node.js API gateway that just works!
Stars: ✭ 88 (+25.71%)
Mutual labels:  http-proxy

Crate Clippy/Fmt Tests Coverage Status

Overview

An implementation of HTTP Tunnel in Rust, which can also function as a TCP proxy.

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.

Please note, this tunnel doesn't allow tunneling of plain text over HTTP tunnels (only HTTPS connections can be tunneled). If you need this functionality you need to build the http-tunnel with the plain_text feature:

cargo build --release --features plain_text

E.g. it can be extended to run the tunnel over QUIC+HTTP/3 or connect to another tunnel (as long as AsyncRead + AsyncWrite is satisfied for the implementation).

You can check benchmarks.

Read more about the design.

Quick overview of source files

  • configuration.rs - contains configuration structures + a basic CLI
    • see config/ with configuration files/TLS materials
  • http_tunnel_codec.rs - a codec to process the initial HTTP request and encode a corresponding response.
  • proxy_target.rs - an abstraction + basic TCP implementation to connect target servers.
    • contains a DNS resolver with a basic caching strategy (cache for a given TTL)
  • relay.rs - relaying data from one stream to another, tunnel = upstream_relay + downstream_relay
    • also, contains basic relay_policy
  • tunnel.rs - a tunnel. It's built from:
    • a tunnel handshake codec (e.g. HttpTunnelCodec)
    • a target connector
    • client connection as a stream
  • main.rs - application. May start HTTP or HTTPS tunnel (based on the command line parameters).
    • emits log to logs/application.log (log/ contains the actual output of the app from the browser session)
    • metrics to logs/metrics.log - very basic, to demonstrate the concept.`

Run demo

Install via cargo:

cargo install http-tunnel

Now you can start it without any configuration:

$ http-tunnel --bind 0.0.0.0:8080 http

There are three modes.

  • HTTPS:
$ http-tunnel --config ./config/config.yaml \
              --bind 0.0.0.0:8443 \
              https --pk "./config/domain.pfx" --password "6B9mZ*1hJ#xk"
  • HTTP:
$ http-tunnel --config ./config/config-browser.yaml --bind 0.0.0.0:8080 http
  • TCP Proxy:
$ http-tunnel --config ./config/config-browser.yaml --bind 0.0.0.0:8080 tcp --destination $REMOTE_HOST:$REMOTE_PORT

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-http-tunnel.org' to /etc/hosts:

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

Then try access-listed targets (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 targets 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

  • Slowloris attack (opening tons of slow connections)
  • Sending requests resulting in large responses

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

Build

Install cargo - follow these instructions

On Debian to fix OpenSSL build issue:

sudo apt-get install pkg-config libssl-dev

Installation

On MacOS:

curl https://sh.rustup.rs -sSf | sh
cargo install http-tunnel
http-tunnel --bind 0.0.0.0:8080 http

On Debian based Linux:

curl https://sh.rustup.rs -sSf | sh
sudo apt-get -y install gcc pkg-config libssl-dev
cargo install http-tunnel
http-tunnel --bind 0.0.0.0:8080 http
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].