{"id":13528057,"url":"https://github.com/moby/vpnkit","last_synced_at":"2025-05-11T05:46:12.008Z","repository":{"id":8633190,"uuid":"58395340","full_name":"moby/vpnkit","owner":"moby","description":"A toolkit for embedding VPN capabilities in your application","archived":false,"fork":false,"pushed_at":"2025-04-24T11:54:00.000Z","size":18110,"stargazers_count":1148,"open_issues_count":80,"forks_count":196,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-05-11T05:46:05.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2016-05-09T17:31:35.000Z","updated_at":"2025-05-07T10:10:34.000Z","dependencies_parsed_at":"2023-01-13T14:54:52.539Z","dependency_job_id":"c8cc4f57-8a58-4b5e-8f40-30283e40a003","html_url":"https://github.com/moby/vpnkit","commit_stats":{"total_commits":1880,"total_committers":39,"mean_commits":"48.205128205128204","dds":0.274468085106383,"last_synced_commit":"6a5c3c5cb0229a4982dad82207863299207bdf06"},"previous_names":["docker/vpnkit"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moby%2Fvpnkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moby%2Fvpnkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moby%2Fvpnkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moby%2Fvpnkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moby","download_url":"https://codeload.github.com/moby/vpnkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523719,"owners_count":21921818,"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":[],"created_at":"2024-08-01T06:02:11.628Z","updated_at":"2025-05-11T05:46:11.989Z","avatar_url":"https://github.com/moby.png","language":"OCaml","funding_links":[],"categories":["OCaml","\u003ca id=\"d62a971d37c69db9f3b9187318c3921a\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"8ea8f890cf767c3801b5e7951fca3570\"\u003e\u003c/a\u003e公网访问局域网"],"readme":"VPN-friendly networking devices for [HyperKit](https://github.com/moby/hyperkit)\n===============================\n\n[![Build Status (OSX)](https://circleci.com/gh/moby/vpnkit.png)](https://circleci.com/gh/moby/vpnkit)\n\nBinary artefacts are built by CI:\n\n- [MacOS](https://circleci.com/gh/moby/vpnkit)\n- [Windows](https://ci.appveyor.com/project/moby/vpnkit/history)\n\n![VPNKit diagram](http://moby.github.io/vpnkit/vpnkit.png)\n\nVPNKit is a set of tools and services for helping [HyperKit](https://github.com/moby/hyperkit)\nVMs interoperate with host VPN configurations.\n\n\nBuilding on Unix (including Mac)\n--------------------------------\n\nFirst install `wget`, `opam`, `pkg-config`, and `dylibbundler` using your\npackage manager of choice.\n\nIf you are an existing `opam` user then you can either build against your existing `opam`\npackage universe, or the custom universe contained in this repo. To use the custom universe,\nensure that you unset your `OPAMROOT` environment variable:\n```\nunset OPAMROOT\n```\n\nTo set up the OCaml build environment, type:\n```\nmake ocaml\n```\nTo install the OCaml dependencies, type:\n```\nmake depends\n```\nTo build:\n```\nmake\n```\n\nWhen the build succeeds the `vpnkit.exe` binary should be available in the current directory.\n\nBuilding on Windows\n-------------------\n\nFirst install the [OCaml environment with Cygwin](https://fdopen.github.io/opam-repository-mingw/installation/).\nNote that although the Cygwin tools are needed for the build scripts, Cygwin itself will not\nbe linked to the final executable.\n\nInside the `OCaml64` (Cygwin) shell, unset the `OPAMROOT` environment and build by:\n```\nunset OPAMROOT\nmake\n```\n\nThe first build will take a little longer as it will build all the package dependencies first.\n\nWhen the build succeeds the `vpnkit.exe` binary should be available in the current directory.\n\nRunning with hyperkit\n---------------------\n\nFirst ask `vpnkit` to listen for ethernet connections on a local Unix domain socket:\n```\nvpnkit --ethernet /tmp/ethernet --debug\n```\nNext ask [com.docker.hyperkit](https://github.com/moby/hyperkit) to connect a NIC to this\nsocket by adding a command-line option like `-s 2:0,virtio-vpnkit,path=/tmp/ethernet`. Note:\nyou may need to change the slot `2:0` to a free slot in your VM configuration.\n\nWhy is this needed?\n-------------------\n\nRunning a VM usually involves modifying the network configuration on the host, for example\nby activating Ethernet bridges, new routing table entries, DNS and firewall/NAT configurations.\nActivating a VPN involves modifying the same routing tables, DNS and firewall/NAT configurations\nand therefore there can be a clash -- this often results in the network connection to the VM\nbeing disconnected.\n\nVPNKit, part of [HyperKit](https://github.com/moby/hyperkit)\nattempts to work nicely with VPN software by intercepting the VM traffic at the Ethernet level,\nparsing and understanding protocols like NTP, DNS, UDP, TCP and doing the \"right thing\" with\nrespect to the host's VPN configuration.\n\nVPNKit operates by reconstructing Ethernet traffic from the VM and translating it into the\nrelevant socket API calls on OSX or Windows. This allows the host application to generate\ntraffic without requiring low-level Ethernet bridging support.\n\nDesign\n------\n\n- [Using vpnkit as a default gateway](docs/ethernet.md): describes the flow of ethernet traffic to/from the VM\n- [Port forwarding](docs/ports.md): describes how ports are forwarded from the host into the VM\n- [Experimental transparent HTTP proxy](docs/transparent-http-proxy.md): describes the\n  experimental support for transparent HTTP(S) proxying\n\nLicensing\n---------\n\nVPNKit is licensed under the Apache License, Version 2.0. See\n[LICENSE](https://github.com/moby/vpnkit/blob/master/LICENSE) for the full\nlicense text.\n\nContributions are welcome under the terms of this license. You may wish to browse\nthe [weekly reports](reports) to read about overall activity in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoby%2Fvpnkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoby%2Fvpnkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoby%2Fvpnkit/lists"}