{"id":16889916,"url":"https://github.com/benoitc/erlang-nat","last_synced_at":"2026-01-28T12:00:43.133Z","repository":{"id":49560853,"uuid":"52447759","full_name":"benoitc/erlang-nat","owner":"benoitc","description":" implements NAT handling facilities for Erlang applications","archived":false,"fork":false,"pushed_at":"2021-12-07T10:32:30.000Z","size":196,"stargazers_count":57,"open_issues_count":8,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-30T00:44:42.324Z","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":"2016-02-24T14:18:19.000Z","updated_at":"2025-08-27T20:57:17.000Z","dependencies_parsed_at":"2022-09-16T07:40:47.662Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/erlang-nat","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/benoitc/erlang-nat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Ferlang-nat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Ferlang-nat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Ferlang-nat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Ferlang-nat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/erlang-nat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Ferlang-nat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-13T16:59:48.413Z","updated_at":"2026-01-28T12:00:43.125Z","avatar_url":"https://github.com/benoitc.png","language":"Erlang","readme":"# erlang-nat\n\nNAT traversal library for Erlang/OTP supporting UPnP IGD, NAT-PMP, and PCP protocols.\n\n[![Hex.pm](https://img.shields.io/hexpm/v/nat.svg)](https://hex.pm/packages/nat)\n[![GitHub Actions](https://github.com/benoitc/erlang-nat/actions/workflows/docs.yml/badge.svg)](https://github.com/benoitc/erlang-nat/actions)\n\n## Documentation\n\n**Full documentation: [benoitc.github.io/erlang-nat](https://benoitc.github.io/erlang-nat/)**\n\n- [Getting Started](https://benoitc.github.io/erlang-nat/getting-started/)\n- [API Reference](https://benoitc.github.io/erlang-nat/api/)\n- [Protocols](https://benoitc.github.io/erlang-nat/protocols/)\n- [Events](https://benoitc.github.io/erlang-nat/events/)\n\n## Features\n\n- **Multiple Protocols**: UPnP IGD (v1 \u0026 v2), NAT-PMP, PCP\n- **Auto-renewal**: Port mappings are automatically renewed before expiry\n- **Event System**: Get notified of mapping changes and IP changes\n- **IPv6 Support**: Full IPv6 support via PCP protocol\n- **OTP Application**: Runs as a supervised OTP application\n\n## Quick Start\n\n```erlang\n%% Add to your rebar.config\n{deps, [{nat, \"0.5.2\"}]}.\n```\n\n```erlang\n%% Start the application\napplication:ensure_all_started(nat).\n\n%% Discover NAT gateway\nok = nat:discover().\n\n%% Get external IP\n{ok, ExtIp} = nat:get_external_address().\n\n%% Add port mapping (auto-renewed)\n{ok, _Since, 8333, 8333, 3600} = nat:add_port_mapping(tcp, 8333, 8333).\n\n%% Register for events\nnat:reg_pid(self()).\nreceive\n    {nat_event, {ip_changed, OldIp, NewIp}} -\u003e\n        io:format(\"IP changed: ~s -\u003e ~s~n\", [OldIp, NewIp])\nend.\n\n%% Delete mapping\nok = nat:delete_port_mapping(tcp, 8333, 8333).\n```\n\n## Requirements\n\n- Erlang/OTP 26 or later\n- rebar3\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Support\n\n- [GitHub Issues](https://github.com/benoitc/erlang-nat/issues)\n- [GitHub Sponsors](https://github.com/sponsors/benoitc)\n","funding_links":["https://github.com/sponsors/benoitc"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Ferlang-nat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Ferlang-nat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Ferlang-nat/lists"}