The pgrok is built and runs as a single binary and meant to be cross platform. Therefore, you should be able to develop pgrok in any major platforms you prefer. However, this guide will focus on macOS only.
The development of pgrok has the following dependencies:
-
Install Homebrew.
-
Install dependencies:
brew install git go pnpm go-task overmind
Generally, you don't need a full clone, so set --depth to 10:
# HTTPS
git clone --depth 10 https://github.com/pgrok/pgrok.git
# or SSH
git clone --depth 10 git@github.com:pgrok/pgrok.gitNote
The repository has Go modules enabled, please clone to somewhere outside of your $GOPATH.
Create a pgrokd.yml file under the repository root and put the following configuration:
external_url: "http://localhost:3320"
web:
port: 3320
proxy:
port: 3000
scheme: "http"
domain: "localhost:3000"
sshd:
port: 2222
database:
path: "./pgrokd.db"
limits:
max_subdomain_count: 5The following command will start processes defined in the Procfile and automatically recompile and restart these servers if related files are changed:
overmind startThen, visit http://localhost:3320!
Few things to note:
- The web, proxy and SSHD servers of the pgrokd are started
- No need to access the Vite server for the pgrokd web app as all requests to it are proxyed by the pgrokd web server
- Create an account in the web UI, then create a subdomain to obtain a token for
pgrok