{"id":31809879,"url":"https://github.com/sarperavci/portgate","last_synced_at":"2025-10-11T05:53:59.739Z","repository":{"id":315711710,"uuid":"1045697394","full_name":"sarperavci/PortGate","owner":"sarperavci","description":"Easily expose local services to the internet. PortGate manages router port forwarding (UPnP/NAT-PMP) directly from the command line, replacing 3rd party services like Ngrok.","archived":false,"fork":false,"pushed_at":"2025-08-28T17:14:43.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-20T08:48:25.473Z","etag":null,"topics":["ngrok","port-forwarding","reverse-shell","self-hosted","server","shell","tunnel","tunneling"],"latest_commit_sha":null,"homepage":"https://portgate.hackmap.win","language":"Python","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/sarperavci.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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-27T15:21:09.000Z","updated_at":"2025-09-14T19:03:20.000Z","dependencies_parsed_at":"2025-09-20T08:48:28.660Z","dependency_job_id":"43d4e5a6-d8fb-4b92-b190-0bb602137404","html_url":"https://github.com/sarperavci/PortGate","commit_stats":null,"previous_names":["sarperavci/portgate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sarperavci/PortGate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarperavci%2FPortGate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarperavci%2FPortGate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarperavci%2FPortGate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarperavci%2FPortGate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarperavci","download_url":"https://codeload.github.com/sarperavci/PortGate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarperavci%2FPortGate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006352,"owners_count":26084088,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ngrok","port-forwarding","reverse-shell","self-hosted","server","shell","tunnel","tunneling"],"created_at":"2025-10-11T05:53:58.559Z","updated_at":"2025-10-11T05:53:59.731Z","avatar_url":"https://github.com/sarperavci.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PortGate\n\n[![PyPI](https://img.shields.io/pypi/v/portgate)](https://pypi.org/project/portgate/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/portgate)](https://pypi.org/project/portgate/)\n[![PyPI - License](https://img.shields.io/pypi/l/portgate)](https://pypi.org/project/portgate/)\n[![Downloads](https://static.pepy.tech/badge/portgate)](https://pepy.tech/project/portgate)\n\nA command-line utility to manage port mappings on your local router using UPnP/NAT-PMP.\nEasily open, close and list ports to expose local services (web servers, game servers, etc.) to the internet without Ngrok, Cloudflare, Serveo, etc.\n\n## Quick Start\n\nJust run the following command to open a port on your router.\n\n```bash\npip install portgate\nportgate \u003clocal_port\u003e\n```\n\n## Features\n\n- Open new port mappings with custom descriptions and TTL\n- Remove existing port mappings\n- List all active port mappings\n- Refresh/renew specific port mappings\n- Clear all port mappings created by PortGate\n- Display router information and WAN IP\n\n## Installation\n\n### For Python users\n\nUse pip to install PortGate.\n\n```bash\npip install portgate\n```\n\n### For Windows users (No Python required)\n\nDownload the standalone Windows executable:\n\n1. Download [portgate-windows_x64.zip](https://github.com/sarperavci/portgate/releases/latest/download/portgate-windows_x64.zip)\n2. Extract the ZIP file\n3. Run `portgate.exe` from the command prompt\n\n```cmd\nportgate.exe \u003clocal_port\u003e\n```\n\n## Usage\n\n### Quick Mode (Recommended)\n\nJust specify the local port you want to forward to the internet.\n\n```bash\nportgate \u003clocal_port\u003e\n```\n\nExample:\n\n```bash\nsarp@IdeaPad:~$ portgate 8000\nPort forwarding established!\nExternal address: 95.65.xxx.xxx:1025\nInternal address: localhost:8000\nPress Ctrl+C to stop forwarding...\n^C\nRemoving port mapping 1025 -\u003e 8000...\nPort mapping removed successfully.\n```\n\n### Command Line Interface\n\n```bash\nportgate \u003ccommand\u003e \u003coptions\u003e\n```\n\n#### Commands\n\n| Command  | Description                      |\n|----------|----------------------------------|\n| `add`    | Open a new port mapping          |\n| `remove` | Remove an existing port mapping  |\n| `list`   | List all active port mappings    |\n| `refresh`| Refresh/renew a specific mapping |\n| `clear`  | Remove all mappings by PortGate  |\n| `info`   | Show router \u0026 WAN IP info        |\n\n#### Options for `add`\n\n| Option              | Description                                | Default     |\n|---------------------|--------------------------------------------|-------------|\n| `-p, --port`        | Internal port to forward                   | *Required*  |\n| `-e, --external`    | External port                              | Same as int.|\n| `-P, --protocol`    | Protocol: TCP, UDP, or BOTH                | TCP         |\n| `-d, --desc`        | Description for the mapping                | \"PortGate\"  |\n| `-t, --ttl`         | Lease duration in seconds (0 = infinite)   | 3600        |\n\n#### Examples\n\n```bash\n# Map TCP port 8080 on WAN to port 8080 on local host, permanent\nportgate add -p 8080 -P TCP -t 0\n\n# Map external port 50000 to internal port 25565\nportgate add -p 25565 -P TCP -e 50000\n\n# Remove TCP port 8080 mapping\nportgate remove -p 8080 -P TCP\n\n# List current UPnP/NAT-PMP mappings\nportgate list\n\n# Display router info and public IP\nportgate info\n```\n\n\n## How It Works\n\nPortGate uses the `miniupnpc` Python library to communicate with your router via UPnP/NAT-PMP protocols. This allows you to:\n\n1. Run a service on a specific port locally (e.g., `python3 -m http.server 55000`)\n2. Use PortGate to create a port mapping through your router\n3. Access your service from the internet using your WAN IP and the mapped port\n\n## Requirements\n\n- Python 3.8 or higher\n- `miniupnpc` Python library\n- Router with UPnP/NAT-PMP enabled","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarperavci%2Fportgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarperavci%2Fportgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarperavci%2Fportgate/lists"}