{"id":16139398,"url":"https://github.com/networkop/smart-vpn-client","last_synced_at":"2025-09-12T00:11:31.709Z","repository":{"id":57563783,"uuid":"332231103","full_name":"networkop/smart-vpn-client","owner":"networkop","description":"Smart VPN client","archived":false,"fork":false,"pushed_at":"2025-01-29T10:34:44.000Z","size":72,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T17:22:15.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networkop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-23T14:35:24.000Z","updated_at":"2025-01-29T10:34:48.000Z","dependencies_parsed_at":"2022-08-31T13:42:28.944Z","dependency_job_id":null,"html_url":"https://github.com/networkop/smart-vpn-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/networkop/smart-vpn-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsmart-vpn-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsmart-vpn-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsmart-vpn-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsmart-vpn-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networkop","download_url":"https://codeload.github.com/networkop/smart-vpn-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsmart-vpn-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273077227,"owners_count":25041358,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-09T23:48:56.870Z","updated_at":"2025-09-01T05:35:24.729Z","avatar_url":"https://github.com/networkop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart VPN client\n\nPerforms all the standard functions of a VPN client, i.e. manages a connection to a VPN headend. The \"smart\" functionality includes:\n\n* Automatic discovery and probing of all available VPN headends. The client will connect to the headend with the lowest round-trip time.\n* Automatic management of routing and NAT masquerade rules required for a VPN client.\n* Periodic VPN connection healthchecks - if more than 3 consecutive healthchecks fail, connection is automatically re-established.\n* VPN connection QoS tracking -- takes a baseline round-trip time measurement when a new connection is established and triggers reconnect when the weighted average latency exceeds 10 x baseline for 3 consecutive measurements.\n\n\n## Supported Providers\n\n* [Private Internet Access](https://www.privateinternetaccess.com/) with Wireguard as the VPN tunnel transport (requires wireguard kernel module).\n\n\n## Installation\n\nTo install run:\n\n```\ngo get github.com/networkop/smart-vpn-client\n```\n\nThe binary can be found in `$GOPATH/bin/`:\n\n```\n# ls -lah $GOPATH/bin/smart-vpn-client\n-rwxr-xr-x 1 root root 7.9M Jan 23 14:57 /go/bin/smart-vpn-client\n```\n\n\n## Run\n\nThe binary requires `NET_ADMIN` capabilities in order to set up interfaces and manipulate routing, therefore the simplest way is to run it with `sudo`:\n\n```\nsudo VPN_PWD=\u003cVPN_PASSWORD\u003e ./smart-vpn-client -user \u003cVPN_USERNAME\u003e\n```\n\n## Using Docker\n\nBuild your own docker image with:\n\n```\nDOCKER_IMAGE=\u003cYOUR_IMAGE_NAME:TAG\u003e make docker\n```\n\nAlternatively, pull a pre-built docker image from dockerhub:\n\n```\ndocker pull networkop/smart-vpn-client:latest\n```\n\nStart a smart vpn client process:\n\n```\ndocker run -e VPN_PWD=\u003cVPN_PASS\u003e -d --restart=always --name vpn --net=host --cap-add=NET_ADMIN networkop/smart-vpn-client -user \u003cVPN_USER\u003e\n```\n\nTo cleanup all config, first stop the container with `docker rm -f vpn` and then do:\n\n```\ndocker run --net=host --cap-add=NET_ADMIN networkop/smart-vpn-client -cleanup\n```\n\nThe last command will run to completion and the container will stop.\n\nTo view the container logs at any stage do:\n\n```\ndocker logs vpn\n```\n\n## Monitor\n\nBy default, all healthchecks metrics are exposed on `localhost:2112/metrics` and can be scraped with Grafana Agent (or Prometheus) like this:\n\n```\nprometheus:\n  configs:\n      scrape_configs:\n      - job_name: vpn\n        scrape_interval: 5s\n        static_configs:\n        - targets: ['localhost:2112']\n```\n\n## Manual build\n\nClone this repo and run: \n\n```\nmake\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fsmart-vpn-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworkop%2Fsmart-vpn-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fsmart-vpn-client/lists"}