{"id":23929300,"url":"https://github.com/kezhengjie/cppnat","last_synced_at":"2025-04-12T07:24:23.488Z","repository":{"id":163339226,"uuid":"478856687","full_name":"kezhengjie/cppnat","owner":"kezhengjie","description":"cppnat is a NAT reverse proxy tool (aslo known as a hole punching tool) helps you expose your private IP and port and bind them onto a server with public IP,access your private service anywhere.","archived":false,"fork":false,"pushed_at":"2024-09-20T06:58:06.000Z","size":15118,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T06:43:47.289Z","etag":null,"topics":["asio","cpp","cpp17","cross-platform","easy-to-use","fluent","high-concurrency","high-performance","hole-punching","modern","nat","nat-hole-punching","nat-traversal","network","no-exception","proxy","reverse-proxy","runtime-safety","simple"],"latest_commit_sha":null,"homepage":"","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/kezhengjie.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-04-07T06:33:09.000Z","updated_at":"2025-02-12T06:31:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e037ff0-5361-4494-9177-2c55d00079d6","html_url":"https://github.com/kezhengjie/cppnat","commit_stats":null,"previous_names":["kezhengjie/cppnat","alpsmonaco/cppnat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezhengjie%2Fcppnat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezhengjie%2Fcppnat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezhengjie%2Fcppnat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezhengjie%2Fcppnat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kezhengjie","download_url":"https://codeload.github.com/kezhengjie/cppnat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248531822,"owners_count":21119823,"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":["asio","cpp","cpp17","cross-platform","easy-to-use","fluent","high-concurrency","high-performance","hole-punching","modern","nat","nat-hole-punching","nat-traversal","network","no-exception","proxy","reverse-proxy","runtime-safety","simple"],"created_at":"2025-01-05T23:16:11.005Z","updated_at":"2025-04-12T07:24:23.466Z","avatar_url":"https://github.com/kezhengjie.png","language":"C++","readme":"# cppnat\n\nwriten in cpp,cppnat is a NAT reverse proxy tool (aslo known as a hole punching tool) helps you expose your private IP and port and bind them onto a server with public IP,access your private service anywhere.\n\n[README](README.md) | [中文文档](README.zh-CN.md)\n\n## build (recommended)\n1. Init git submodules in `thirt_party/`.  \n2. Use `CMake` to generate platform project file.`CmakeLists.txt` file is in the root path of this repository.  \n### Linux\n```sh\nmkdir build ; cd build ; cmake .. ; make \n```\nIf the compile is successful,you will have both `server` and `client` in the `bin/` directory of this repository.  \nThe default `server.json` and `client.json` are also included in the `bin/` directory,change them to satisfy you needs.\n\n### Windows\n```bat\nmkdir build \u0026 cd build \u0026\u0026 cmake .. \n```\nOpen `cppnat.sln` and compile `cppnat` using `Visual Studio`.  \nYou will have `server.exe` and `client.exe` in `Visual Studio` build output directory,  \ncould be `Release/` or `Debug/` depends on which mode you choose to compile.  \nAlso `server.json` and `client.json` will be copied to the directory,  \nchange them to satisfy you needs.\n\n\n## build (deprecated)\n1. Init git submodules in `thirt_party/`.\n2. run `build_server.sh` and `build_client.sh` on linux os, requires at least `g++ 10`.  \nFor Windows system with MSVC compiler `cl.exe` has installed,run `build_server.bat` and `build_client.bat`.\n3. If the compile is successful,you will have `server` and `client` in the `bin/` directory.  \nThe default `server.json` and `client.json` are also included in the `bin/` directory,change them to satisfy you needs.\n\n## run\nThere are `bin/server.json` and `bin/client.json` template config file in the `bin/` directory.Simply change them to satisfy you needs.\n\n## config\n\n### server\n`bin/server` is typically dispatched on a server with public ip.Every TCP connection to the ip and the port you have configured will be redirected to nat client.  \n\n#### `server.json`\n```json\n{\n    \"bind_ip\": \"0.0.0.0\",\n    \"bind_port\": 54432\n}\n```\nThere are only two keys in the config json file indicates on which ip and which port the nat server should bind.  \n\n\n### client\n`bin/client` is typically dispatched on a computer without a public ip but able to connect to the Internet with NAT.  \nA client helps you expose you service such as ssh or rdp to the Internet that you could access it anywhere.  \n\n#### `client.json`\n```json\n{\n    \"server_ip\": \"127.0.0.1\",\n    \"server_port\": 54432,\n    \"proxy_ip\": \"127.0.0.1\",\n    \"proxy_port\": 33123\n}\n```\nconfigure `server_ip` and `server_port` to a nat server's binded ip and binded port.  \nconfigure `proxy_ip` and `proxy_port` to you local private service.\n\n**Now you could access you private service anywhere**\nbased on asio,this library performs well under high concurrency as well.  \n\n\n## Project\n\nThis library is written with `Visual Studio Code`,you could open this project of root path and launch it directly.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkezhengjie%2Fcppnat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkezhengjie%2Fcppnat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkezhengjie%2Fcppnat/lists"}