{"id":17920187,"url":"https://github.com/lostmsu/portforwarding","last_synced_at":"2025-04-03T08:27:50.142Z","repository":{"id":243708831,"uuid":"813211476","full_name":"lostmsu/PortForwarding","owner":"lostmsu","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-15T05:21:57.000Z","size":4876,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"lost","last_synced_at":"2025-04-02T06:09:33.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lostmsu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T17:24:47.000Z","updated_at":"2025-03-15T05:22:01.000Z","dependencies_parsed_at":"2025-03-15T06:21:55.732Z","dependency_job_id":"060d2393-6672-4fce-ac26-ad2374db22c4","html_url":"https://github.com/lostmsu/PortForwarding","commit_stats":null,"previous_names":["lostmsu/portforwarding"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostmsu%2FPortForwarding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostmsu%2FPortForwarding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostmsu%2FPortForwarding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostmsu%2FPortForwarding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostmsu","download_url":"https://codeload.github.com/lostmsu/PortForwarding/tar.gz/refs/heads/lost","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246964283,"owners_count":20861635,"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-10-28T20:21:44.446Z","updated_at":"2025-04-03T08:27:50.122Z","avatar_url":"https://github.com/lostmsu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://github.com/lontivero/Open.NAT/raw/gh-pages/images/logos/128.jpg)\n\n[![NuGet](https://img.shields.io/nuget/v/Lost.PortForwarding.svg)](https://www.nuget.org/packages/Lost.PortForwarding/)\n\nLost.PortForwarding\n======\n\nLost.PortForwarding is a lightweight and easy-to-use class library to allow port forwarding in NAT devices that support UPNP (Universal Plug \u0026 Play) and/or PMP (Port Mapping Protocol).\n\n\nGoals\n-----\nNATed computers cannot be reached from outside and this is particularly painful for peer-to-peer or friend-to-friend software.\nThe main goal is to simplify communication amoung computers behind NAT devices that support UPNP and/or PMP providing a clean\nand easy interface to get the external IP address and map ports and helping you to achieve peer-to-peer communication.\n\n+ Tested with .NET  _YES_\n+ Tested with Mono  _YES_\n\nHow to use?\n-----------\nWith nuget :\n\u003e **Install-Package Lost.PortForwarding**\n\nGo on the [nuget website](https://www.nuget.org/packages/Lost.PortForwarding/) for more information.\n\nExample\n--------\n\nThe simplest scenario:\n\n```c#\nvar discoverer = new NatDiscoverer();\nvar device = await discoverer.DiscoverDeviceAsync();\nvar ip = await device.GetExternalIPAsync();\nConsole.WriteLine(\"The external IP Address is: {0} \", ip);\n```\n\nThe following piece of code shows a common scenario: It starts the discovery process for a NAT-UPNP device and onces discovered it creates a port mapping. If no device is found before ten seconds, it fails with NatDeviceNotFoundException.\n\n\n```c#\nvar discoverer = new NatDiscoverer();\nvar cts = new CancellationTokenSource(10000);\nvar device = await discoverer.DiscoverDeviceAsync(PortMapper.Upnp, cts);\n\nawait device.CreatePortMapAsync(new Mapping(Protocol.Tcp, 1600, 1700, \"The mapping name\"));\n```\n\nFor more info please check the [Wiki](https://github.com/lontivero/Lost.PortForwarding/wiki)\n\nDocumentation\n-------------\n+ Why Lost.PortForwarding? Here you have [ten reasons](https://github.com/lontivero/Lost.PortForwarding/wiki/Why-Lost.PortForwarding) that make Lost.PortForwarding a good candidate for you projects\n+ [Visit the Wiki page](https://github.com/lontivero/Lost.PortForwarding/wiki)\n\nDevelopment\n-----------\nLost.PortForwarding is been developed by [Lucas Ontivero](http://geeks.ms/blogs/lontivero) ([@lontivero](http://twitter.com/lontivero)).\nYou are welcome to contribute code. You can send code both as a patch or a GitHub pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostmsu%2Fportforwarding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostmsu%2Fportforwarding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostmsu%2Fportforwarding/lists"}