Skip to content

Repository files navigation

Gopher in the middle proxy

Overview

gitmproxy is a lightweight MITM (Man-In-The-Middle) HTTP cache proxy designed for caching HTTP(S) traffic for slow internet/network connections.

Configuration Environment Variables

The following environment variables can be used to configure gitmproxy:

VariableDescriptionDefault
LISTEN_ADDRAddress and port for the proxy server to listen on:8090
CACHE_DIRDirectory where cache files are storedcache
MAX_SIZEMaximum total cache size (e.g., 10GB, 0 = unlimited)10GB
ENTRY_MAX_SIZEMaximum size for a single cached response (e.g., 500MB)500MB
ENTRY_TTLTime-to-live for each cache entry (e.g., 1h, 0 = none)1h
ENABLE_LOGGINGEnable logging of cache operations (true/false)true
IGNORE_SERVER_CACHE_CONTROLIgnore cache control headers from the server (true/false)false

Getting Started

Here is an example of how to run gitmproxy using Docker Compose:

services:
gitmproxy:
image: ghcr.io/bboehmke/gitmproxy:masterports:
- "8090:8090"environment:
LISTEN_ADDR: ":8090"CACHE_DIR: "cache"MAX_SIZE: "10GB"ENTRY_MAX_SIZE: "500MB"ENTRY_TTL: "1h"ENABLE_LOGGING: "true"IGNORE_SERVER_CACHE_CONTROL: "false"volumes:
- ./cache:/cache

This will start gitmproxy on port 8090 with a persistent cache directory. Adjust environment variables and volume paths as needed for your setup.

Prometheus Metrics Endpoint

gitmproxy exposes a Prometheus-compatible metrics endpoint at /_gitmproxy_metrics.

  • You can access metrics by visiting http://<proxy_host>:<proxy_port>/_gitmproxy_metrics.
  • This endpoint provides statistics such as HTTP request counts and cache performance.
  • Integrate this endpoint with your Prometheus server for monitoring.

About

HTTP cache proxy with SSL interception

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages