{"id":15630674,"url":"https://github.com/database64128/swgp-go","last_synced_at":"2025-04-12T19:48:02.995Z","repository":{"id":37671848,"uuid":"468305169","full_name":"database64128/swgp-go","owner":"database64128","description":"🐉 Simple WireGuard proxy with minimal overhead for WireGuard traffic.","archived":false,"fork":false,"pushed_at":"2025-04-09T07:43:44.000Z","size":535,"stargazers_count":252,"open_issues_count":4,"forks_count":27,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-12T19:47:45.948Z","etag":null,"topics":["golang","proxy","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/database64128.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}},"created_at":"2022-03-10T11:00:32.000Z","updated_at":"2025-04-09T07:43:49.000Z","dependencies_parsed_at":"2023-11-08T00:16:52.936Z","dependency_job_id":"446bc871-3bad-43c8-9db6-bd9a03835644","html_url":"https://github.com/database64128/swgp-go","commit_stats":{"total_commits":236,"total_committers":4,"mean_commits":59.0,"dds":0.4533898305084746,"last_synced_commit":"800260adb8f338c6d605680fd144147463c0767b"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/database64128%2Fswgp-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/database64128%2Fswgp-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/database64128%2Fswgp-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/database64128%2Fswgp-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/database64128","download_url":"https://codeload.github.com/database64128/swgp-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625497,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["golang","proxy","wireguard"],"created_at":"2024-10-03T10:34:59.085Z","updated_at":"2025-04-12T19:48:02.972Z","avatar_url":"https://github.com/database64128.png","language":"Go","funding_links":[],"categories":["Libraries"],"sub_categories":["Go"],"readme":"# swgp-go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/database64128/swgp-go.svg)](https://pkg.go.dev/github.com/database64128/swgp-go)\n[![Test](https://github.com/database64128/swgp-go/actions/workflows/test.yml/badge.svg)](https://github.com/database64128/swgp-go/actions/workflows/test.yml)\n[![Release](https://github.com/database64128/swgp-go/actions/workflows/release.yml/badge.svg)](https://github.com/database64128/swgp-go/actions/workflows/release.yml)\n\n🐉 Simple WireGuard proxy with minimal overhead for WireGuard traffic.\n\n## Proxy modes\n\n### 1. Zero overhead\n\n- Encrypts the first 16 bytes as an AES block.\n- Adds padding of random length to handshake packets, then encrypts all bytes after the first 16 using XChaCha20-Poly1305.\n\n#### When to use\n\n- ✅ Does not affect tunnel MTU.\n- ✅ Minimal processing of data packets.\n\n### 2. Paranoid\n\nPackets are padded to the maximum packet size allowed by the MTU, then encrypted using XChaCha20-Poly1305.\n\n#### When to use\n\n- ✅ Full-packet AEAD.\n- ✅ Hides in-tunnel packet sizes.\n    - The length of a WireGuard data packet is always a multiple of 16.\n    - Many IPv6 websites cap their outgoing MTU to 1280 for maximum compatibility.\n- ❗️ Slight reduction of tunnel MTU.\n- ❗️ Increased bandwidth usage.\n\n## Deployment\n\n### Arch Linux package\n\nRelease and VCS packages are available in the AUR:\n\n- [![swgp-go AUR package](https://img.shields.io/aur/version/swgp-go?label=swgp-go)](https://aur.archlinux.org/packages/swgp-go)\n- [![swgp-go-git AUR package](https://img.shields.io/aur/version/swgp-go-git?label=swgp-go-git)](https://aur.archlinux.org/packages/swgp-go-git)\n\n### Prebuilt binaries\n\nDownload from [releases](https://github.com/database64128/swgp-go/releases).\n\n### Container images\n\nThere are container images maintained by the community:\n\n- [vnxme/docker-swgp-go](https://github.com/vnxme/docker-swgp-go)\n\n### Build from source\n\nBuild and install the latest version using Go:\n\n```sh\ngo install github.com/database64128/swgp-go/cmd/swgp-go@latest\n```\n\nOr clone the repository and build it manually:\n\n```sh\ngo build -trimpath -ldflags '-s -w' ./cmd/swgp-go\n```\n\n## Configuration\n\nAll configuration examples and systemd unit files can be found in the [docs](docs) directory.\n\n`swgp-go` uses the same PSK format as WireGuard. A PSK can be generated using `wg genpsk` or `openssl rand -base64 32`.\n\nMake sure to use the right MTU for both server and client. To encourage correct use, `swgp-go` disables IP fragmentation and drops packets that are bigger than expected.\n\n### 1. Server\n\nIn this example, `swgp-go` runs a proxy server instance on port 20220. Decrypted WireGuard packets are forwarded to `[::1]:20221`.\n\n```json\n{\n    \"servers\": [\n        {\n            \"name\": \"server\",\n            \"proxyListen\": \":20220\",\n            \"proxyMode\": \"zero-overhead\",\n            \"proxyPSK\": \"sAe5RvzLJ3Q0Ll88QRM1N01dYk83Q4y0rXMP1i4rDmI=\",\n            \"proxyFwmark\": 0,\n            \"wgEndpoint\": \"[::1]:20221\",\n            \"wgFwmark\": 0,\n            \"mtu\": 1500\n        }\n    ]\n}\n```\n\n### 2. Client\n\nIn this example, `swgp-go` runs a proxy client instance on port 20222. Encrypted proxy packets are sent to the proxy server at `[2001:db8:1f74:3c86:aef9:a75:5d2a:425e]:20220`.\n\n```json\n{\n    \"clients\": [\n        {\n            \"name\": \"client\",\n            \"wgListen\": \":20222\",\n            \"wgFwmark\": 0,\n            \"proxyEndpoint\": \"[2001:db8:1f74:3c86:aef9:a75:5d2a:425e]:20220\",\n            \"proxyMode\": \"zero-overhead\",\n            \"proxyPSK\": \"sAe5RvzLJ3Q0Ll88QRM1N01dYk83Q4y0rXMP1i4rDmI=\",\n            \"proxyFwmark\": 0,\n            \"mtu\": 1500\n        }\n    ]\n}\n```\n\n## License\n\n[AGPL-3.0-or-later](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabase64128%2Fswgp-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabase64128%2Fswgp-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabase64128%2Fswgp-go/lists"}