A MITM (Man-In-The-Middle) HTTP/HTTPS proxy that logs HTTPS requests and responses for debugging and testing purposes.
- Logs HTTPS request and response details.
- View traffic through a browser UI.
- Docker & CLI supported.
- Supports custom DNS mappings and JKS SSL certificates.
- JDK 19+
- HTTPS certificate and private key (in JKS format).
- If using self-signed certificates, consider using mkcert.
📄 more info: mkcert.md
Suppose you're intercepting traffic for https://www.example.com (IP: 192.168.3.3).
Edit your system's host file (e.g., /etc/hosts
or C:\Windows\System32\drivers\etc\hosts
):
127.0.0.1 www.example.com
sbt "runMain Main --dns=192.168.3.3:www.example.com --jks-path=jks.jks --jks-password=123456 --viewPort=9000"
Create a private.conf
file with the following content:
jks {
path = "/server/config/jks.jks"
password = "123456"
}
resolver = [114.114.114.114]
viewerPort = 9000
# selfSignedCert = "" # Uncomment if using a self-signed cert
Then run:
docker run --rm \
-v ${PWD}/private.conf:/server/config/application.conf \
-v ${PWD}/jks.jks:/server/config/jks.jks \
-p 443:443 -p 9000:9000 \
ghcr.io/timzaak/log-http-proxy:latest
Open your browser and navigate to
http://127.0.0.1:9000
to view traffic logs. or with iphttp://127.0.0.1:9000?ip=${http client ip}
Name | Description |
---|---|
--dns |
A list of IP:domain mappings to inject into the DNS resolver. |
--jks-path |
Path to the JKS file containing the SSL certificate and key. |
--jks-password |
Password for the JKS keystore. |
--resolver |
(Optional) DNS resolver to use (e.g., 1.1.1.1 ). |
--viewPort |
(Optional) Port for the web UI or WebSocket logging. |
# Package with sbt
sbt stage
# Then package with jpackage
cd package
version="0.1.0"
jpackage \
--name https-proxy \
--input ../target/universal/stage/lib \
--main-jar https-proxy.https-proxy-${version}.jar \
--main-class Main \
--type app-image \
--win-console
- Brotli compression (Accept-Encoding: br) is not supported. This header will be stripped.
- remote-address headers are not retained.
Note: Windows users may need to use
tshark
instead.
ssh user@remote 'tcpdump -i any -w - -U port <port>' | wireshark -k -i -
kubectl debug -it <pod-name> -n <namespace> \
--image=nicolaka/netshoot \
--target=<container-name>
Use tcpdump inside the debug container to capture traffic.