{"id":23701834,"url":"https://github.com/fijxu/natpmp-crystal","last_synced_at":"2026-01-30T09:30:15.601Z","repository":{"id":270277264,"uuid":"909845959","full_name":"Fijxu/natpmp-crystal","owner":"Fijxu","description":"Crystal library implementation of RFC 6886 (NAT-PMP), client side.","archived":false,"fork":false,"pushed_at":"2025-01-13T14:21:45.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T04:41:31.878Z","etag":null,"topics":["client","crystal","library","nat-pmp","rfc-6886","simple"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/Fijxu.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":"2024-12-29T23:14:01.000Z","updated_at":"2025-01-13T14:21:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"47f3b36e-8055-45fb-949c-0890db9db542","html_url":"https://github.com/Fijxu/natpmp-crystal","commit_stats":null,"previous_names":["fijxu/natpmp-crystal"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fijxu%2Fnatpmp-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fijxu%2Fnatpmp-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fijxu%2Fnatpmp-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fijxu%2Fnatpmp-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fijxu","download_url":"https://codeload.github.com/Fijxu/natpmp-crystal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239780121,"owners_count":19695734,"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":["client","crystal","library","nat-pmp","rfc-6886","simple"],"created_at":"2024-12-30T10:56:49.736Z","updated_at":"2026-01-30T09:30:15.527Z","avatar_url":"https://github.com/Fijxu.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# natpmp-crystal\n\nWork in progress implementation of RFC 6886 **NAT Port Mapping Protocol (NAT-PMP)**, client side.\n\nSince RFC 6886 is a pretty simple protocol, it should be ready to use to requests mappings\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     natpmp-crystal:\n       github: fijxu/natpmp-crystal\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\n# Create NAT-PMP client, replace the IP by the IP of your\n# gateway\nclient = NatPMP::Client.new(\"192.168.1.1\")\n# Public address request\nclient.send_public_address_request # =\u003e {0, 128, 0, 22758, \"104.0.0.0\"}\nclient.send_public_address_request_as_bytes # =\u003e Bytes[0, 128, 0, 0, 0, 0, 88, 230, 104, 0, 0, 0]\n\n# Maps the internal port 25565 to external port 25565, TCP\nclient.request_mapping(25565, 25565, 2) # =\u003e {0, 130, 0, 22758, 25565, 25565, 7200}\n# Destroys the mapping with internal port 25565, TCP\nclient.destroy_mapping(25565, 2) # =\u003e {0, 130, 0, 22758, 25565, 0, 0}\n\n# Maps the internal port 22000 to external port 22000, UDP\nclient.request_mapping(22000, 22000, 1) # =\u003e {0, 129, 0, 22758, 22000, 22000, 7200}\n# Destroys the mapping with internal port 22000, UDP\nclient.destroy_mapping(22000, 1) # =\u003e {0, 129, 0, 22758, 22000, 0, 0}\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/fijxu/natpmp-crystal/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Fijxu](https://github.com/fijxu) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffijxu%2Fnatpmp-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffijxu%2Fnatpmp-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffijxu%2Fnatpmp-crystal/lists"}