{"id":13438668,"url":"https://github.com/jedisct1/dsvpn","last_synced_at":"2025-05-13T16:11:11.556Z","repository":{"id":41525215,"uuid":"197432758","full_name":"jedisct1/dsvpn","owner":"jedisct1","description":"A Dead Simple VPN.","archived":false,"fork":false,"pushed_at":"2025-04-10T17:55:46.000Z","size":195,"stargazers_count":5206,"open_issues_count":1,"forks_count":399,"subscribers_count":118,"default_branch":"master","last_synced_at":"2025-04-23T20:58:21.497Z","etag":null,"topics":["privacy","reallysimple","simple","vpn"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedisct1.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":"2019-07-17T17:19:19.000Z","updated_at":"2025-04-17T14:50:12.000Z","dependencies_parsed_at":"2022-08-10T02:35:34.619Z","dependency_job_id":"5ebe3002-2f71-41ed-a4d9-8cc4222f8037","html_url":"https://github.com/jedisct1/dsvpn","commit_stats":{"total_commits":279,"total_committers":14,"mean_commits":"19.928571428571427","dds":0.07526881720430112,"last_synced_commit":"641926ae7dfc76370c104913083f4a57ab2feb7c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fdsvpn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fdsvpn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fdsvpn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fdsvpn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedisct1","download_url":"https://codeload.github.com/jedisct1/dsvpn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514767,"owners_count":21443208,"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":["privacy","reallysimple","simple","vpn"],"created_at":"2024-07-31T03:01:07.389Z","updated_at":"2025-04-23T20:58:26.887Z","avatar_url":"https://github.com/jedisct1.png","language":"C","funding_links":[],"categories":["C","\u003ca id=\"1a9934198e37d6d06b881705b863afc8\"\u003e\u003c/a\u003e通信\u0026\u0026代理\u0026\u0026反向代理\u0026\u0026隧道","HarmonyOS","Misc","Security","\u003ca id=\"d62a971d37c69db9f3b9187318c3921a\"\u003e\u003c/a\u003e工具","vpn","OS"],"sub_categories":["\u003ca id=\"56acb7c49c828d4715dce57410d490d1\"\u003e\u003c/a\u003e未分类-Proxy","Windows Manager","VPN","\u003ca id=\"8ea8f890cf767c3801b5e7951fca3570\"\u003e\u003c/a\u003e公网访问局域网"],"readme":"# ![DSVPN](https://raw.github.com/jedisct1/dsvpn/master/logo.png)\n\n[![GitHub CI status](https://github.com/jedisct1/dsvpn/workflows/CI/badge.svg)](https://github.com/jedisct1/dsvpn/actions)\n![CodeQL scan](https://github.com/jedisct1/dsvpn/workflows/CodeQL%20scan/badge.svg)\n\nDSVPN is a Dead Simple VPN, designed to address the most common use case for using a VPN:\n\n```text\n[client device] ---- (untrusted/restricted network) ---- [vpn server] ---- [the Internet]\n```\n\nFeatures:\n\n* Runs on TCP. Works pretty much everywhere, including on public WiFi where only TCP/443 is open or reliable.\n* Uses only modern cryptography, with formally verified implementations.\n* Small and constant memory footprint. Doesn't perform any heap memory allocations.\n* Small (~25 KB), with an equally small and readable code base. No external dependencies.\n* Works out of the box. No lousy documentation to read. No configuration file. No post-configuration. Run a single-line command on the server, a similar one on the client and you're done. No firewall and routing rules to manually mess with.\n* Works on Linux (kernel \u003e= 3.17), macOS and OpenBSD, as well as DragonFly BSD, FreeBSD and NetBSD in client and point-to-point modes. Adding support for other operating systems is trivial.\n* Doesn't leak between reconnects if the network doesn't change. Blocks IPv6 on the client to prevent IPv6 leaks.\n\n## Installation\n\n```sh\nmake\n```\n\nOn Raspberry Pi 3 and 4, use the following command instead to enable NEON optimizations:\n\n```sh\nenv OPTFLAGS=-mfpu=neon make\n```\n\nAlternatively, if you have [zig](https://ziglang.org) installed, it can be used to compile DSVPN:\n\n```sh\nzig build -Drelease\n```\n\nOn macOS, DSVPN can be installed using Homebrew: `brew install dsvpn`.\n\n## Secret key\n\nDSVPN uses a shared secret. Create it with the following command:\n\n```sh\ndd if=/dev/urandom of=vpn.key count=1 bs=32\n```\n\nAnd copy it on the server and the client.\n\nIf required, keys can be exported and imported in printable form:\n\n```sh\nbase64 \u003c vpn.key\necho 'HK940OkWcFqSmZXnCQ1w6jhQMZm0fZoEhQOOpzJ/l3w=' | base64 --decode \u003e vpn.key\n```\n\n## Example usage on the server\n\n```sh\nsudo ./dsvpn server vpn.key auto 1959\n```\n\nHere, I use port `1959`. Everything else is set to the default values. If you want to use the default port (`443`), it doesn't even have to be specified, so the parameters can just be `server vpn.key`\n\n## Example usage on the client\n\n```sh\nsudo ./dsvpn client vpn.key 34.216.127.34 1959\n```\n\nThis is a macOS client, connecting to the VPN server `34.216.127.34` on port `1959`. The port number is optional here as well. And the IP can be replaced by a host name.\n\n## That's it\n\nYou are connected. Just hit `Ctrl`-`C` to disconnect.\n\nEvaggelos Balaskas wrote a great blog post walking through the whole procedure: [A Dead Simple VPN](https://balaskas.gr/blog/2019/07/20/a-dead-simple-vpn/).\n\nHe also maintains [systemd service files for DSVPN](https://github.com/ebal/scripts/tree/master/dsvpn). Thank you Evaggelos!\n\n## A note on DNS\n\nIf you were previously using a DNS resolver only accessible from the local network, it won't be accessible through the VPN. That might be the only thing you may have to change. Use a public resolver, a local resolver, or DNSCrypt.\n\nOr send a pull request implementing the required commands to change and revert the DNS settings, or redirect DNS queries to another resolver, for all supported operating systems.\n\n## Advanced configuration\n\n```text\ndsvpn   \"server\"\n        \u003ckey file\u003e\n        \u003cvpn server ip or name\u003e|\"auto\"\n        \u003cvpn server port\u003e|\"auto\"\n        \u003ctun interface\u003e|\"auto\"\n        \u003clocal tun ip\u003e|\"auto\"\n        \u003cremote tun ip\u003e\"auto\"\n        \u003cexternal ip\u003e|\"auto\"\n\ndsvpn   \"client\"\n        \u003ckey file\u003e\n        \u003cvpn server ip or name\u003e\n        \u003cvpn server port\u003e|\"auto\"\n        \u003ctun interface\u003e|\"auto\"\n        \u003clocal tun ip\u003e|\"auto\"\n        \u003cremote tun ip\u003e|\"auto\"\n        \u003cgateway ip\u003e|\"auto\"\n```\n\n* `server`|`client`: use `server` on the server, and `client` on clients.\n* `\u003ckey file\u003e`: path to the file with the secret key (e.g. `vpn.key`).\n* `\u003cvpn server ip or name\u003e`: on the client, it should be the IP address or the hostname of the server. On the server, it doesn't matter, so you can just use `auto`.\n* `\u003cvpn server port\u003e`: the TCP port to listen to/connect to for the VPN. Use 443 or anything else. `auto` will use `443`.\n* `\u003ctun interface\u003e`: this is the name of the VPN interface. On Linux, you can set it to anything. Or macOS, it has to follow a more boring pattern. If you feel lazy, just use `auto` here.\n* `\u003clocal tun ip\u003e`: local IP address of the tunnel. Use any private IP address that you don't use here.\n* `\u003cremote tun ip\u003e`: remote IP address of the tunnel. See above. The local and remote tunnel IPs must the same on the client and on the server, just reversed. For some reason, I tend to pick `192.168.192.254` for the server, and `192.168.192.1` for the client. These values will be used if you put `auto` for the local and remote tunnel IPs.\n* `\u003cexternal ip\u003e` (server only): the external IP address of the server. Can be left to `\"auto\"`.\n* `\u003cgateway ip\u003e` (client only): the internal router IP address. The first line printed by `netstat -rn` will tell you (`gateway`).\n\nIf all the remaining parameters of a command would be `auto`, they don't have to be specified.\n\n## Related projects\n\n* Robert Debock maintains [an Ansible role for DSVPN](https://github.com/robertdebock/ansible-role-dsvpn)\n* [OpenMPTCProuter](http://www.openmptcprouter.com/) is an OpenWRT-based router OS that supports DSVPN\n* Yecheng Fu maintains a [Docker image for DSVPN](https://github.com/cofyc/dsvpn-docker)\n\n## Why\n\nI needed a VPN that works in an environment where only TCP/80 and TCP/443 are open.\n\nWireGuard doesn't work over TCP.\n\n[GloryTun](https://github.com/angt/glorytun) is excellent, but requires post-configuration and the maintained branch uses UDP.\n\nI forgot about [VTUN-libsodium](https://github.com/jedisct1/vtun). But it would have been too much complexity and attack surface for a simple use case.\n\nOpenVPN is horribly difficult to set up.\n\nSshuttle is very nice and I've been using it a lot in the past, but it's not a VPN. It doesn't tunnel non-TCP traffic. It also requires a full Python install, which I'd rather avoid on my router.\n\nEverything else I looked at was either too difficult to use, slow, bloated, didn't work on macOS, didn't work on small devices, was complicated to cross-compile due to dependencies, wasn't maintained, or didn't feel secure.\n\nTCP-over-TCP is not as bad as some documents describe. It works surprisingly well in practice, especially with modern congestion control algorithms (BBR). For traditional algorithms that rely on packet loss, DSVPN couples the inner and outer congestion controllers by lowering `TCP_NOTSENT_LOWAT` and dropping packets when congestion is detected at the outer layer.\n\n## Cryptography\n\nThe cryptographic primitives used in DSVPN are available as a standalone project: [Charm](https://github.com/jedisct1/charm).\n\n## Guarantees, support, feature additions\n\nNone.\n\nThis is not intended to be a replacement for GloryTun or WireGuard. This is what I use, because it solves a problem I had. Extending it to solve different problems is not planned, but feel free to fork it and tailor it to your needs!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Fdsvpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedisct1%2Fdsvpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Fdsvpn/lists"}