{"id":17424533,"url":"https://github.com/isundaylee/stun","last_synced_at":"2025-04-16T00:45:08.705Z","repository":{"id":145730432,"uuid":"97773336","full_name":"isundaylee/stun","owner":"isundaylee","description":"A simple layer-3 network tunnel written in C++.","archived":false,"fork":false,"pushed_at":"2020-08-09T22:03:57.000Z","size":111288,"stargazers_count":7,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T03:12:36.509Z","etag":null,"topics":["network","network-tunnel","router","tunnel"],"latest_commit_sha":null,"homepage":"","language":"C++","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/isundaylee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-07-20T00:35:01.000Z","updated_at":"2021-07-28T21:19:10.000Z","dependencies_parsed_at":"2023-06-15T08:30:21.806Z","dependency_job_id":null,"html_url":"https://github.com/isundaylee/stun","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isundaylee%2Fstun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isundaylee%2Fstun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isundaylee%2Fstun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isundaylee%2Fstun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isundaylee","download_url":"https://codeload.github.com/isundaylee/stun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249177960,"owners_count":21225346,"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":["network","network-tunnel","router","tunnel"],"created_at":"2024-10-17T05:42:23.541Z","updated_at":"2025-04-16T00:45:08.688Z","avatar_url":"https://github.com/isundaylee.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stun\n\n[![GitHub version](https://badge.fury.io/gh/isundaylee%2Fstun.svg)](https://badge.fury.io/gh/isundaylee%2Fstun)\n\n`stun` (Simple TUNnel), as its name stands, is a simple layer-3 network tunnel written in C++. It allows you to easily establish a network tunnel between two computers, and route packets through them.\n\nEach `stun` tunnel consists of two ends: 1) the server, which listens for incoming tunneling requests, and 2) the client, which connects to a server to establish a tunnel. A `stun` server is also capable of serving as a router that provides Internet access for its clients via itself.\n\nCurrently `stun` supports the following platforms:\n\n- Linux (client and server)\n- macOS (client only)\n- iOS (client only)\n- FreeBSD (client only)\n\n## Installation\n\n### macOS\n\n`stun` can be obtained on macOS via [Homebrew](https://brew.sh). Once you have Homebrew installed, you can install `stun` with:\n\n```\nbrew install isundaylee/repo/stun\n```\n\nNote that currently `stun` can only be used as a client on macOS (see the introduction paragraph for the distinction).\n\n### Ubuntu\n\nThe following installation script has been tested on Ubuntu 14.04 and 16.04:\n\n```\ncurl -L https://raw.githubusercontent.com/isundaylee/stun/master/bootstrap.sh | bash\n```\n\nIt will download `stun` and install the binary to `/usr/local/bin`. Note that it will also enable IP forwarding on the machine (which is necessary if you want to use the machine as a `stun` server to provide Internet accesses to your clients). If you don't want IP forwarding enabled, you can use the following command to disable it again after running the bootstrap script:\n\n```\necho 0 | sudo tee /proc/sys/net/ipv4/ip_forward\n```\n\nAlso note that the install script only enables IP forwarding temporarily until the next reboot. To enable it permanently, edit `/etc/sysctl.conf` and set `net.ipv4.ip_foward` to `1`.\n\n### Compile from source\n\n`stun` uses the [Buck](https://buckbuild.com) build system. Once you have Buck set up for your system, use the following command at the root directory of the repo to compile a release version of `stun`:\n\n```\nbuck build :main#release\n```\n\nIt is recommended to build `stun` with clang 4.0 or above. To point Buck to use a specific `clang++` binary, create a file named `.buckconfig.local` in the root directory of the repo with the following content:\n\n```\n[cxx]\n  cxxpp = /path/to/clang++\n  cpp = /path/to/clang++\n  cxx = /path/to/clang++\n  ld = /path/to/clang++\n```\n\n## Usage\n\nTo start `stun`, simply do\n\n```\nsudo stun\n```\n\nUpon the first time you start `stun`, you will be prompted to create a config file. Simply answer the prompt questions (note that the secret used on the client end needs to match the secret used on the server end), and a config file would be automatically generated for you at `~/.stunrc`.\n\nFor the client end, the default configuration file would forward all Internet traffic through the `stun` tunnel. To selectively forward traffic, manually edit the `forward_subnets` and `exclude_subnets` entries in the generated config file at `~/.stunrc`. The config file is in standard JSON format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisundaylee%2Fstun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisundaylee%2Fstun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisundaylee%2Fstun/lists"}