Skip to content

Public Tunnels

Public tunnels offer a secure and efficient way to connect local servers to the wider internet. These tunnels enable developers to share, test, and collaborate on web applications directly from their local environments. By creating a bridge between a local server and a public endpoint, public tunnels facilitate real-time demonstrations, remote testing, and seamless integration of webhooks and services.

Ngrok is a multiplatform tunnelling, reverse proxy software that enables you to expose a web server running on your local machine to the internet. We use this tool in building, testing, and sharing applications. It’s also handy for quickly demonstrating our work to clients or colleagues for real-time feedback.

We primarily use public tunnels for the following reasons:

  • Demoing Websites: Allows us to share a public URL of their localhost server with clients or teammates.
  • Testing Mobile Applications: Facilitates on-device mobile app testing by exposing a local web server to the internet.
  • Webhooks Development: Essential for developing features that require a public URL for webhooks on a local server.
  • Command:
    Terminal window
    brew install --cask ngrok
  • Ensure all changes are applied by restarting your terminal after installation.
  • Command:
    Terminal window
    ngrok http PORT_YOUR_LOCAL_INSTANCE_IS_RUNNING_ON
    Replace PORT_YOUR_LOCAL_INSTANCE_IS_RUNNING_ON with your specific port number.
  • If using Pow, a zero-config Rack server for Mac OS X, use the following command:
    Terminal window
    ngrok http -host-header=example.dev example.dev:80
    Replace example.dev with your specific Pow site.

For more detailed information on using ngrok, visit their official documentation here.