{"id":13801157,"url":"https://github.com/benoitc/nat_upnp","last_synced_at":"2025-05-13T11:30:53.107Z","repository":{"id":9270151,"uuid":"11099158","full_name":"benoitc/nat_upnp","owner":"benoitc","description":"Erlang library to map your internal port to an external using UNP IGD ","archived":true,"fork":false,"pushed_at":"2019-07-03T03:49:11.000Z","size":176,"stargazers_count":42,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T00:07:31.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitc.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}},"created_at":"2013-07-01T15:37:50.000Z","updated_at":"2024-05-17T16:41:15.000Z","dependencies_parsed_at":"2022-09-22T15:52:10.315Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/nat_upnp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fnat_upnp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fnat_upnp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fnat_upnp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fnat_upnp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/nat_upnp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932772,"owners_count":21986445,"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-04T00:01:20.160Z","updated_at":"2025-05-13T11:30:52.348Z","avatar_url":"https://github.com/benoitc.png","language":"Erlang","readme":"** **DEPRECATED** ** Please look at https://github.com/benoitc/erlang-nat to replace it.\n\n\n\n\n\n\n\n\n\n\n\n# nat_upnp - Make your port public using UNP #\n\nCopyright (c) 2013 Benoît Chesneau.\n\n__Version:__ 0.1.0\n\n# nat_upnp\n\n**nat_upnp** is an Erlang library library that provides you a way to o\nmap a local port to the external using [UPnP\nIGD](http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol).\n\nThe usage of **nat_upnp** is pretty simple and just the minimum of the\nUNP to map a local port to the external.\n\n## Example of usage\n\n### Discover the router\n\n```\n1\u003e {ok, Context} = nat_upnp:discover().\n{ok,{nat_upnp,\"http://192.168.1.254:5678/control/wan_ip_connection\",\n              \"192.168.1.45\"}}\n```\n\n### Add a port mapping\n\n```\n2\u003e Protocol = tcp,\n2\u003e ExternalPort = 5638,\n2\u003e InternalPort = 5638,\n2\u003e Description = \"test nat upnp\",\n2\u003e Timeout = 0,\n2\u003e ok = nat_upnp:add_port_mapping(Context, Protocol, ExternalPort, InternalPort, Description, Timeout).\nok\n```\n\n\u003e Note: Timeout = 0 mean, the port will never be released (ie. infinite\n\u003e timeout)\n\n### Remove a port mapping\n\n```\n3\u003e ok = nat_upnp:delete_port_mapping(Context, Protocol, ExternalPort).\nok\n```\n\n\u003e Note: don't forget to remove the port you registered to the router\n\u003e when you exit the application or close the port. For example you could\n\u003e monitor the process that maintain the socket and when it's closing,\n\u003e unregister the port. Of course there are many other way to achieve\n\u003e that purpose.\n\n## Contribute\n\nFor issues, comments or feedback please [create an\nissue](http://github.com/benoitc/nat_upnp/issues).\n\n### Notes for developers\n\nIf you want to contribute patches or improve the doc, you will need to\nbuild nat_unp using the `rebar_dev.config`  file. It can also be built\nusing the **Makefile**:\n\n```\n$ make dev ; # compile \u0026 get deps\n$ make devclean ; # clean all files\n```\n\n\n## Modules ##\n\n\n\u003ctable width=\"100%\" border=\"0\" summary=\"list of modules\"\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"http://github.com/benoitc/nat_upnp/blob/master/doc/nat_upnp.md\" class=\"module\"\u003enat_upnp\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"http://github.com/benoitc/nat_upnp/blob/master/doc/nat_upnp_proto.md\" class=\"module\"\u003enat_upnp_proto\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n","funding_links":[],"categories":["Networking"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fnat_upnp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Fnat_upnp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fnat_upnp/lists"}