All Projects → hauke96 → Tiny Http Proxy

hauke96 / Tiny Http Proxy

Licence: apache-2.0
Maybe the tiniest HTTP proxy that also has a cache

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Tiny Http Proxy

Free Proxy List
🔥Free proxy servers list / Updated hourly!
Stars: ✭ 326 (+858.82%)
Mutual labels:  proxy, http-proxy
Jwtproxy
An HTTP-Proxy that adds AuthN through JWTs
Stars: ✭ 379 (+1014.71%)
Mutual labels:  proxy, http-proxy
Compoxure
Proxy middleware for express that enables composition of microservices.
Stars: ✭ 332 (+876.47%)
Mutual labels:  cache, proxy
Citadelcore
Cross platform filtering HTTP/S proxy based on .NET Standard 2.0.
Stars: ✭ 28 (-17.65%)
Mutual labels:  proxy, http-proxy
Multitor
Create multiple TOR instances with a load-balancing.
Stars: ✭ 624 (+1735.29%)
Mutual labels:  proxy, http-proxy
Httptunnel
Bidirectional data stream tunnelled in HTTP requests.
Stars: ✭ 279 (+720.59%)
Mutual labels:  proxy, http-proxy
Proxy requests
a class that uses scraped proxies to make http GET/POST requests (Python requests)
Stars: ✭ 357 (+950%)
Mutual labels:  proxy, http-proxy
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+5267.65%)
Mutual labels:  cache, proxy
Awslambdaproxy
An AWS Lambda powered HTTP/SOCKS web proxy
Stars: ✭ 571 (+1579.41%)
Mutual labels:  proxy, http-proxy
Proxy admin free
Proxy是高性能全功能的http代理、https代理、socks5代理、内网穿透、内网穿透p2p、内网穿透代理、内网穿透反向代理、内网穿透服务器、Websocket代理、TCP代理、UDP代理、DNS代理、DNS加密代理,代理API认证,全能跨平台代理服务器。
Stars: ✭ 487 (+1332.35%)
Mutual labels:  proxy, http-proxy
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+8438.24%)
Mutual labels:  proxy, http-proxy
Rotating Proxy
Rotating TOR proxy with Docker
Stars: ✭ 739 (+2073.53%)
Mutual labels:  proxy, http-proxy
Bus
Bus 是一个基础框架、服务套件,它基于Java8编写,参考、借鉴了大量已有框架、组件的设计,可以作为后端服务的开发基础中间件。代码简洁,架构清晰,非常适合学习使用。
Stars: ✭ 253 (+644.12%)
Mutual labels:  cache, proxy
Fiddler Plus
自定义的Fiddler规则,多环境切换、解决跨域开发、快速调试线上代码必备|高效调试分析利器
Stars: ✭ 325 (+855.88%)
Mutual labels:  proxy, http-proxy
Haproxy
HAProxy Load Balancer's development branch (mirror of git.haproxy.org)
Stars: ✭ 2,463 (+7144.12%)
Mutual labels:  cache, proxy
Rocky
Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js
Stars: ✭ 357 (+950%)
Mutual labels:  proxy, http-proxy
Mallory
HTTP/HTTPS proxy over SSH
Stars: ✭ 251 (+638.24%)
Mutual labels:  proxy, http-proxy
Trafficserver
Apache Traffic Server™ is a fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server.
Stars: ✭ 1,258 (+3600%)
Mutual labels:  cache, proxy
Memento
Memento is a development-only tool that caches HTTP calls once they have been executed.
Stars: ✭ 380 (+1017.65%)
Mutual labels:  cache, proxy
Iisexpress Proxy
A simple local proxy for accessing IIS Express from remote machines.
Stars: ✭ 633 (+1761.76%)
Mutual labels:  proxy, http-proxy

tiny-http-proxy

Maybe the tiniest HTTP proxy that also has a cache.

The tiny-http-proxy acts as a reverse proxy for one server of your choice illustrated by this picture:

           network            proxy             cache
         .---------.       .---------.       .---------.
    <----|- - < - -|---<---|- - < - -|---<---|- < -.   |
you ---->|- - > - -|--->---|- -,- > -|--->---|- > -|   |
         |         |       |   |(*)  |       |     |   |
         |    ,-< -|---<---|< -'     |       |     |   |
         |    , ,->|--->---|- - > - -|--->---|- > -'   |
         `----+-+--´       `---------´       `---------´
              ' '
              '_'
            website

(*) When the data is not in the cache, the website will be requested and is directly stored in the cache.

Where "network" may be anything (LAN/WAN/...).

Installation

Just clone this repo and run it:

git clone https://github.com/hauke96/tiny-http-proxy.git
cd tiny-http-proxy
mkdir cache
go run *.go

Of course you can also use the ZIP-archive if you don't have git installed.

Instead of mkdir cache, you have to make sure that the folder you'll configure later exists.

Configuration

All the configuration is done in the tiny.json file. This is a simple JSON-file with some properties that should be set by you:

Property Type Description
port string The port this server is listening to.
target string The target host every request should be routed to.
cache_folder string The folder where the cache files are stored. This folder must exist and must be writable.
debug_logging bool When set to true, more detailed log output is printed.
max_cache_item_size int Maximum size in MB for the in-memory cache. Larger files are only cached on disk, smaller files are also cached directly within the memory.

Usage

If you normally go to http://foo.com/bar?request=test then now go to http://localhost:8080/bar?request=test (assumed there's a correct configuration).

Exmaples

With the given config

The current configuration caches requests to https://imgs.xkcd.com. So just start the proxy and go to e.g.:

http://localhost:8080/comics/campaign_fundraising_emails.png

Caching google searches

Example: Create a proxy for google:

{
    "port": "8080",
    "target": "http://www.google.com/",
    "cache_folder": "./cache/"
}

Then using the proxy with the URL http://localhost:8080/search?source=hp&ei=QmBwWtTMHojOwAK2146oDQ&btnG=Suche&q=go+(language) will open the result page of a google search for "go (language)". You may notice, that the site looks different then the original one. This happens because the proxy does not change links in the HTML (e.g. to css files).

The cache folder now contains files that are requested when opening the site (the HTML page, the favicon or other images):

5,4K 5b99ab35db77d3f6b8fada5270bc47b924ee8cca8b446d5d17cb6eed57bd372f
5,4K 802264eb0ff19278f578bfe80df00b9ed3b9ee67f670c2d6cea2d330cb7a49eb
152K 8988bca2a82bd9d3d52f03e0ecc7068db934d627f3a369f736e769360c968d93
   0 aaa75631890ab943c5ac2033591cb4287d1a6085604a74dc854a6117e6a0e104
 51K b9a229ca754de56be3c2743e5a51deac09e170c05388cc2c14b2e70608d9d4e4
 12K e5c601f8012efac42f37f43427272d2e9ec9756b2d401fab2a495dd3b96266bc

A great thing: Accessing another google search site, some images are not downloaded twice. Long live the cache!

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].