Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.97 KB

File metadata and controls

73 lines (51 loc) · 1.97 KB

Set up your development environment

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.

Step 1: Install dependencies

The development of pgrok has the following dependencies:

  1. Install Homebrew.

  2. Install dependencies:

    brew install git go pnpm go-task overmind

Step 2: Get the code

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.git

Note

The repository has Go modules enabled, please clone to somewhere outside of your $GOPATH.

Step 3: Initialize pgrokd.yml

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: 5

Step 4: Start the servers

The following command will start processes defined in the Procfile and automatically recompile and restart these servers if related files are changed:

overmind start

Then, 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