Run a local Sourcegraph instance behind ngrok
Sometimes it's useful to have the Sourcegraph instance you're running on your local machine to be reachable over the internet. If you're testing webhooks, for example, where a code host needs to be able to send requests to your instances.
One way to do that is to use ngrok, a reverse proxy that allows you to expose your instance to the internet.
brew install ngrok
- Authenticate the
ngrokif this is your first time running it (the token can be obtained from Ngrok dashboard):
ngrok config add-authtoken <Your token>
- Start your Sourcegraph instance:
ngrokand point it at Sourcegraph:
ngrok http --host-header=rewrite 3080
- Copy the
- Edit your site-config (i.e.
../dev-private/enterprise/dev/site-config.json) and update the
"externalURL"to point to your ngrok:
- Open the ngrok URL in browser to make sure you see your instance