{"id":18463907,"url":"https://github.com/vimpunk/natpp","last_synced_at":"2025-10-27T06:11:39.256Z","repository":{"id":117061936,"uuid":"141851519","full_name":"vimpunk/natpp","owner":"vimpunk","description":"(Going to be an) Asio integrated C++17 port mapping library (supports NATPMP and [soon] UPnP)","archived":false,"fork":false,"pushed_at":"2018-08-05T20:39:17.000Z","size":23,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T01:02:15.351Z","etag":null,"topics":[],"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/vimpunk.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}},"created_at":"2018-07-21T23:09:14.000Z","updated_at":"2024-01-05T06:36:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"b817a5e5-4d81-46ba-b8ef-9a9697853213","html_url":"https://github.com/vimpunk/natpp","commit_stats":null,"previous_names":["vimpunk/natpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fnatpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fnatpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fnatpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimpunk%2Fnatpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimpunk","download_url":"https://codeload.github.com/vimpunk/natpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249146017,"owners_count":21220071,"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-11-06T09:08:20.307Z","updated_at":"2025-10-27T06:11:34.219Z","avatar_url":"https://github.com/vimpunk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# natpp\n\nThis library lets you create [port mappings](https://en.wikipedia.org/wiki/Port_forwarding) using\nthe well established Asio C++ networking library.\n\n## Asio\n\nThis library integrates deeply with the Asio framework by providing an IO service backend and corresponding IO\nobject classes for each protocol type. Currently it only works with the standalone version of Asio, but support for independent Asio sources (i.e. standalone or Boost) is in the plans.\n\n## Work-in-progress note\n\nSince this library is work-in-progress, currently it only supports the [NATPMP protocol](https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol).\nHowever, support for [UPnP port forwarding](https://en.wikipedia.org/wiki/Universal_Plug_and_Play#NAT_traversal) is in the works and should land soon.\n\n## Usage\n\n```c++\n#include \u003casio.hpp\u003e\n#include \u003cnatpp/natpmp.hpp\u003e\n\nint main()\n{\n  asio::io_context io;\n  nat::natpmp natpmp(io);\n  \n  natpmp.async_public_address([](nat::error_code error, asio::ip::address addr) {\n        if(!error) {\n          // TODO print addr\n        }\n      });\n      \n  nat::port_mapping mapping;\n  mapping.private_port = 55555;\n  mapping.public_port = 55555;\n  mapping.duration = std::chrono::hours(2);\n  natpmp.async_request_mapping(mapping,\n      [](nat::error_code error, nat::port_mapping mapping) {\n        if(!error) {\n          // TODO print mapping\n        }\n      });\n      \n  io.run();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimpunk%2Fnatpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimpunk%2Fnatpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimpunk%2Fnatpp/lists"}