{"id":13490111,"url":"https://github.com/pgrok/pgrok","last_synced_at":"2026-02-11T15:03:34.065Z","repository":{"id":131420996,"uuid":"611249232","full_name":"pgrok/pgrok","owner":"pgrok","description":"Poor man's ngrok - a multi-tenant HTTP/TCP reverse tunnel solution through SSH remote port forwarding","archived":false,"fork":false,"pushed_at":"2026-02-01T16:03:34.000Z","size":488,"stargazers_count":3438,"open_issues_count":7,"forks_count":120,"subscribers_count":19,"default_branch":"main","last_synced_at":"2026-02-01T23:36:00.275Z","etag":null,"topics":["go","http","ngrok-alternative","oidc","pgrok","reverse-tunnel","ssh-tunnel","sso","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/pgrok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","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":"2023-03-08T12:43:55.000Z","updated_at":"2026-02-01T16:03:12.000Z","dependencies_parsed_at":"2023-10-03T08:59:13.520Z","dependency_job_id":"bfa4831f-5a6c-4bc9-954c-a13d9010869f","html_url":"https://github.com/pgrok/pgrok","commit_stats":{"total_commits":184,"total_committers":12,"mean_commits":"15.333333333333334","dds":0.5108695652173914,"last_synced_commit":"1b6ee0cf73b7553b8f9c9aaaff84725a6835e36c"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/pgrok/pgrok","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrok%2Fpgrok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrok%2Fpgrok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrok%2Fpgrok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrok%2Fpgrok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgrok","download_url":"https://codeload.github.com/pgrok/pgrok/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrok%2Fpgrok/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29336029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T14:34:07.188Z","status":"ssl_error","status_checked_at":"2026-02-11T14:34:06.809Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","http","ngrok-alternative","oidc","pgrok","reverse-tunnel","ssh-tunnel","sso","tcp"],"created_at":"2024-07-31T19:00:40.947Z","updated_at":"2026-02-11T15:03:34.048Z","avatar_url":"https://github.com/pgrok.png","language":"Go","readme":"![pgrok banner](https://user-images.githubusercontent.com/2946214/227126410-3e9dae19-d0c0-4a96-9040-1322e389c8db.png)\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003ePoor man's ngrok\u003c/h3\u003e\n  \u003ca href=\"https://sourcegraph.com/github.com/pgrok/pgrok\"\u003e\u003cimg src=\"https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge\u0026logo=sourcegraph\" alt=\"Sourcegraph\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## What?\n\nThe pgrok is a multi-tenant HTTP/TCP reverse tunnel solution through remote port forwarding from the SSH protocol.\n\nThis is intended for small teams that need to expose the local development environment to the public internet, and you need to bring your own domain name and SSO provider.\n\nIt gives stable subdomain for every user, and gated by your SSO through OIDC protocol.\n\nThink of this as a bare-bones alternative to the [ngrok's $65/user/month enterprise tier](https://ngrok.com/pricing) (at the time of founding this project, they have since changed pricing). Trying to put this behind a production system will blow up your SLA.\n\nFor individuals and production systems, just buy ngrok, it is still my favorite.\n\n## Why?\n\nStable subdomains and SSO are two things too expensive.\n\nWhy not just pick one from the [Awesome Tunneling](https://github.com/anderspitman/awesome-tunneling)? Think broader. Not everyone is a dev who knows about server operations. For people working as community managers, sales, and PMs, booting up something locally could already be a stretch and requiring them to understand how to set up and fix server problems is a waste of team's productivity.\n\nCopy, paste, and run is the best UX for everyone.\n\n## How?\n\nBefore you get started, make sure you have the following:\n\n1. A domain name (e.g. `example.com`, this will be used as the example throughout this section).\n1. A server (dedicated server, VPS) with a public IP address (e.g. `111.33.5.14`).\n1. An SSO provider (e.g. Google, JumpCloud, Okta, GitLab, Keycloak) that allows you to create OIDC clients.\n1. A PostgreSQL server (Render, Vercel, Cloud SQL, self-host).\n\n\u003e [!NOTE]\n\u003e 1. All values used in this document are just examples, substitute based on your setup.\n\u003e 1. All examples in this document use HTTP for brevity, you may refer to our example walkthrough of [setting HTTPS with Caddy and Cloudflare](https://github.com/pgrok/pgrok/blob/main/docs/admin/https.md).\n\n### Set up the server (`pgrokd`)\n\n1. Add the following DNS records for your domain name:\n    1. `A` record for `example.com` to `111.33.5.14` (with **DNS only** if using Cloudflare)\n    1. `A` record for `*.example.com` to `111.33.5.14` (with **DNS only** if using Cloudflare)\n1. Set up the server with the [single binary](./docs/admin/single-binary.md), [Docker](./docs/admin/docker.md#standalone-docker-container) or [Docker Compose](./docs/admin/docker.md#docker-compose).\n1. Alter your network security policy (if applicable) to allow inbound requests to port `2222` from `0.0.0.0/0` (anywhere).\n1. [Download and install Caddy 2](https://caddyserver.com/docs/install) on your server, and use the following Caddyfile config:\n    ```caddyfile\n    http://example.com {\n        reverse_proxy * localhost:3320\n    }\n\n    http://*.example.com {\n        reverse_proxy * localhost:3000\n    }\n    ```\n1. Create a new OIDC client in your SSO with the **Redirect URI** to be `http://example.com/-/oidc/callback`.\n\n### Set up the client (`pgrok`)\n\n1. Go to http://example.com, authenticate with your SSO to obtain the token and URL (e.g. `http://unknwon.example.com`).\n1. Download the latest version of the `pgrok`:\n    - For Homebrew:\n        ```sh\n        brew install pgrok\n        ```\n    - For others, download the archive from the [Releases](https://github.com/pgrok/pgrok/releases) page.\n1. Initialize a `pgrok.yml` file with the following command (assuming you want to forward requests to `http://localhost:3000`):\n    ```sh\n    pgrok init --remote-addr example.com:2222 --forward-addr http://localhost:3000 --token {YOUR_TOKEN}\n    ```\n    - By default, the config file is created under the [standard user configuration directory (`XDG_CONFIG_HOME`)](https://github.com/adrg/xdg):\n        - macOS: `~/Library/Application Support/pgrok/pgrok.yml`\n        - Linux: `~/.config/pgrok/pgrok.yml`\n        - Windows: `%LOCALAPPDATA%\\pgrok\\pgrok.yml`\n    - Use `--config` flag to specify a different path for the config file.\n1. Launch the client by executing the `pgrok` or `pgrok http` command.\n    - By default, `pgrok` expects the `pgrok.yml` is available under the standard user configuration directory, or under the home directory (`~/.pgrok/pgrok.yml`). Use `--config` flag to specify a different path for the config file.\n    - Use the `--debug` flag to turn on debug logging.\n    - Upon successful startup, you should see a log looks like:\n        ```\n        🎉 You're ready to go live at http://unknwon.example.com! remote=example.com:2222\n        ```\n1. Now visit the URL.\n\nAs a special case, the first argument of the `pgrok http` can be used to specify forward address, e.g.\n\n```\npgrok http 8080\n```\n\n#### Raw TCP tunnels\n\n\u003e [!IMPORTANT]\n\u003e You need to alter the server network security policy (if applicable) to allow additional inbound requests to port range 10000-15000 from `0.0.0.0/0` (anywhere).\n\nUse the `tcp` subcommand to tunnel raw TCP traffic:\n\n```\npgrok tcp 5432\n```\n\nUpon successful startup, you should see a log looks like:\n\n```\n🎉 You're ready to go live at tcp://example.com:10086! remote=example.com:2222\n```\n\nThe assigned TCP port on the server side is semi-stable, such that the same port number is used when still available.\n\n#### Override config options\n\nFollowing config options can be overridden through CLI flags for both `http` and `tcp` subcommands:\n\n- `--remote-addr, -r` -\u003e `remote_addr`\n- `--forward-addr, -f` -\u003e `forward_addr`\n- `--token, -t` -\u003e `token`\n\n#### HTTP dynamic forwards\n\nTypical HTTP reverse tunnel solutions only support forwarding requests to a single address, `pgrok` can be configured to have dynamic forward rules when tunneling HTTP requests.\n\nFor example, if your local frontend is running at `http://localhost:3000` but some gRPC endpoints need to talk to the backend directly at `http://localhost:8080`:\n\n```yaml\ndynamic_forwards: |\n  /api http://localhost:8080\n  /hook http://localhost:8080\n```\n\nThen all requests prefixed with the path `/api` and `/hook` will be forwarded to `http://localhost:8080` and all the rest are forwarded to the `forward_addr` (`http://localhost:3000`).\n\n### Vanilla SSH\n\nBecause the standard SSH protocol is used for tunneling, you may well just use the vanilla SSH client.\n\n1. Go to http://example.com, authenticate with your SSO to obtain the token and URL (e.g. `http://unknwon.example.com`).\n1. Launch the client by executing the `ssh -N -R 0::3000 example.com -p 2222` command:\n    1. Enter the token as your password.\n    1. Use the `-v` flag to turn on debug logging.\n    1. Upon successful startup, you should see a log looks like:\n        ```\n        Allocated port 22487 for remote forward to :3000\n        ```\n1. Now visit the URL.\n\n## Explain it to me\n\n![pgrok network diagram](https://user-images.githubusercontent.com/2946214/229048941-cc12139d-f250-49fa-806d-19c27996ee09.png)\n\n## Contributing\n\nPlease read through our [contributing guide](.github/contributing.md) and [set up your development environment](docs/dev/local_development.md).\n\n## Sponsors\n\n\u003cp\u003e\n  \u003ca href=\"https://www.bytebase.com?ref=unknwon\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sqlchat/sqlchat/main/public/bytebase.webp\" width=300\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Credits\n\nThe project wouldn't be possible without reading [function61/holepunch-server](https://github.com/function61/holepunch-server), [function61/holepunch-client](https://github.com/function61/holepunch-client), and [TCP/IP Port Forwarding](https://github.com/apache/mina-sshd/blob/master/docs/technical/tcpip-forwarding.md).\n\n## License\n\nThis project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","funding_links":[],"categories":["开源类库","Go","HarmonyOS","go","Repositories"],"sub_categories":["网络","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrok%2Fpgrok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgrok%2Fpgrok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrok%2Fpgrok/lists"}