{"id":49562322,"url":"https://github.com/renaudallard/thinproxy","last_synced_at":"2026-05-26T07:01:25.861Z","repository":{"id":345345969,"uuid":"1185498697","full_name":"renaudallard/thinproxy","owner":"renaudallard","description":"Lightweight, secure, single-file HTTP/HTTPS proxy in C with zero dependencies","archived":false,"fork":false,"pushed_at":"2026-05-03T09:09:18.000Z","size":142,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-03T10:27:59.851Z","etag":null,"topics":["c","capsicum","connect-tunnel","freebsd","http-proxy","https-proxy","lightweight","linux","no-dependencies","openbsd","proxy","seccomp-bpf","secure","single-file","small","unveil"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renaudallard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T16:40:39.000Z","updated_at":"2026-05-03T09:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/renaudallard/thinproxy","commit_stats":null,"previous_names":["renaudallard/thinproxy"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/renaudallard/thinproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renaudallard%2Fthinproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renaudallard%2Fthinproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renaudallard%2Fthinproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renaudallard%2Fthinproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renaudallard","download_url":"https://codeload.github.com/renaudallard/thinproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renaudallard%2Fthinproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33508317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","capsicum","connect-tunnel","freebsd","http-proxy","https-proxy","lightweight","linux","no-dependencies","openbsd","proxy","seccomp-bpf","secure","single-file","small","unveil"],"created_at":"2026-05-03T10:05:17.628Z","updated_at":"2026-05-26T07:01:25.849Z","avatar_url":"https://github.com/renaudallard.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thinproxy\n\nLightweight, asynchronous HTTP/HTTPS proxy written in C.\nZero dependencies, single file, minimal attack surface.\n\n## Features\n\n- HTTP request forwarding with header rewriting\n- HTTPS tunneling via CONNECT method\n- IPv4 and IPv6 support\n- Single-threaded, non-blocking I/O with poll(2)\n- Asynchronous DNS resolution via forked child processes\n- Zero-copy kernel relay for CONNECT tunnels on OpenBSD (SO_SPLICE)\n- Source IP access control lists (allow/deny with CIDR)\n- CONNECT port whitelist (default: 443 only)\n- Private/reserved address blocking (SSRF protection)\n- Per-IP connection limits\n- Privilege dropping after bind\n- OpenBSD pledge(2)/unveil(2) and Linux seccomp-BPF sandboxing\n- Automatic bind retry on restart\n- ~25 KB memory per connection\n\n## Build\n\n```\nmake\n```\n\nBuilds on OpenBSD, Linux (glibc and musl), macOS, FreeBSD, NetBSD, and DragonFlyBSD.\n\n## Install\n\n```\nmake install\n```\n\nThe default prefix is `/usr/local`. Override with:\n\n```\nmake install PREFIX=/usr DESTDIR=/tmp/pkg\n```\n\n### OpenBSD\n\n```sh\nrcctl enable thinproxy\nrcctl start thinproxy\n```\n\n### Linux (systemd)\n\n```sh\nsudo systemctl daemon-reload\nsudo systemctl enable --now thinproxy\n```\n\n## Usage\n\n```\nthinproxy [-dVv] [-b address] [-f config] [-p port] [-u user]\n```\n\n| Flag | Description |\n|------|-------------|\n| `-b address` | Bind address (default: `127.0.0.1`) |\n| `-d` | Daemonize and log to syslog |\n| `-f config` | Configuration file (default: `/etc/thinproxy.conf`) |\n| `-p port` | Listen port (default: `8080`) |\n| `-u user` | Drop privileges to user after bind |\n| `-V` | Print version and exit |\n| `-v` | Log each request with client IP |\n\nCommand-line flags override configuration file values.\n\n### Examples\n\n```sh\nthinproxy                                    # default settings\nthinproxy -v -b 0.0.0.0 -p 3128             # all interfaces, verbose\nthinproxy -d -u _thinproxy                   # daemon with privilege drop\nthinproxy -f /etc/thinproxy/thinproxy.conf   # custom config\n\ncurl -x http://127.0.0.1:8080 http://example.com\ncurl -x http://127.0.0.1:8080 https://example.com\n```\n\n## Configuration\n\nDefault path: `/etc/thinproxy.conf` (silently ignored if missing).\nSee `thinproxy.conf.example` for a full example.\n\n### General\n\n| Directive | Description | Default |\n|-----------|-------------|---------|\n| `listen` | Bind address | `127.0.0.1` |\n| `port` | Listen port | `8080` |\n| `user` | Drop privileges to user | none |\n| `daemon` | Run as daemon (`yes`/`no`) | `no` |\n| `verbose` | Verbose logging (`yes`/`no`) | `no` |\n\n### Limits\n\n| Directive | Description | Default |\n|-----------|-------------|---------|\n| `max_connections` | Max concurrent connections (1-512) | `512` |\n| `max_connections_per_ip` | Max connections per source IP (1-512) | `32` |\n| `idle_timeout` | Idle timeout in seconds (1-86400) | `300` |\n\n### Security\n\n| Directive | Description | Default |\n|-----------|-------------|---------|\n| `deny_private` | Block private/reserved destinations (`yes`/`no`) | `yes` |\n| `connect_port` | Allowed CONNECT port (repeatable) | `443` |\n| `allow` | Allow source address/CIDR (whitelist mode) | |\n| `deny` | Deny source address/CIDR (blacklist mode) | |\n\n### Access Control\n\nUse `allow` or `deny` directives, but not both.\nWhen `allow` is used, unlisted addresses are denied.\nWhen `deny` is used, unlisted addresses are allowed.\nBoth IPv4 and IPv6 with optional CIDR prefix are supported.\n\n### Example Configuration\n\n```\nlisten 0.0.0.0\nport 3128\nuser _thinproxy\ndaemon yes\ndeny_private yes\nconnect_port 443\nconnect_port 8443\nmax_connections_per_ip 16\nallow 192.168.1.0/24\nallow 127.0.0.1\n```\n\n## Platform Notes\n\n### OpenBSD\n\n- pledge(2) restricts syscalls to `stdio inet dns proc`\n- unveil(2) restricts filesystem to `/etc/resolv.conf` and `/etc/hosts`\n- SO_SPLICE provides zero-copy kernel relay for CONNECT tunnels\n- accept4(2) with SOCK_NONBLOCK avoids extra fcntl(2) per connection\n- Native strlcpy(3), closefrom(2), and strtonum(3)\n\n### Linux\n\n- seccomp-BPF restricts syscalls to an allowlist (I/O, networking, DNS, process forking)\n- Supports x86_64 and aarch64\n- POSIX-compatible fallbacks for BSD-specific functions\n- Packages available as `.deb`, `.rpm`, `.apk`, and static binaries\n\n### macOS, FreeBSD, NetBSD, DragonFlyBSD\n\n- POSIX-compatible fallbacks for BSD-specific functions\n- Static binaries available for FreeBSD, NetBSD, and DragonFlyBSD\n\n## License\n\nBSD 2-Clause. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenaudallard%2Fthinproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenaudallard%2Fthinproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenaudallard%2Fthinproxy/lists"}