examplecode/mproxy logo

examplecode/mproxy

Free

c 语言实现的一个最小的http代理,代理支持设置加密隧道,可以躲避防火墙的监测

FreeFree tier
Type
Open Source

About examplecode/mproxy

mproxy is a minimal HTTP proxy server written in C, with core code under 500 lines and no third-party dependencies (Unix-like only). It supports HTTP proxy, HTTPS tunneling, and a simple encrypted tunnel mode. The encrypted tunnel allows client-server pairing to bypass firewalls (e.g., GFW). It operates in two modes: normal proxy for basic forwarding, and an encrypted tunnel mode where data is encrypted between client and server. Compilation is straightforward with gcc. Usage examples include running as a daemon and configuring browser proxy settings (e.g., using SwitchSharp). The project is a prototype, tested successfully with major sites like Facebook, Twitter, YouTube, and Google, but compatibility is not guaranteed for all websites.

Key Features

HTTP proxy and HTTPS tunnel support
Simple encrypted tunnel mode for bypassing censorship
Core code under 500 lines of C, no third-party dependencies
Lightweight and compiles with single gcc command
Daemon mode support (-d flag)
Client-server architecture for encrypted mode (-E/-D flags)

Pros & Cons

Pros
  • Extremely lightweight and simple codebase (under 500 lines)
  • No external dependencies, easy to compile on Unix-like systems
  • Encrypted tunnel mode provides basic obfuscation for bypassing firewalls
  • Tested with popular blocked sites (Facebook, Twitter, YouTube, Google)
Cons
  • Prototype quality – not fully stable or compatible with all websites
  • Only works on Unix-like systems (no native Windows support, but can be shared via network)
  • Limited documentation and no active releases or package management
  • No caching, authentication, or advanced proxy features

Best For

Basic HTTP proxy for forwarding requestsCircumventing internet censorship (e.g., GFW) via encrypted tunnelLearning and prototyping minimal proxy implementations in C

FAQ

What operating systems does mproxy support?
mproxy only runs on Unix-like operating systems (Linux, macOS, etc.). It does not natively support Windows, but you can share an already deployed instance with Windows users via its IP address.
How do I use mproxy to bypass internet censorship?
Deploy mproxy in encrypted tunnel mode: run a server on a remote machine outside the censorship zone with '-l 8081 -D -d', and a client on your local machine with '-l 8080 -h server_ip:8081 -E'. Then configure your browser's HTTP proxy to localhost:8080.
Is mproxy compatible with all websites?
No. The developer notes it is a prototype and has been tested with Facebook, Twitter, YouTube, and Google, but full compatibility is not guaranteed.
How do I compile mproxy?
Run 'gcc -o mproxy mproxy.c' in the source directory. No additional libraries are required.