After today’s experiments I found out this information about local WordPress development and tunnels (when you need to work with webhooks).
Expose by BeyondCode
beyoncode/expose v1 used to work, but extra code was needed on the WP side (I wrote a blog post about that). Not sure whether their API still supports v1, but v2 does not work like that anymore.
I tried to configure v2, but failed – the WordPress site was redirecting me back to my local site. I was using a free version, so maybe the situation is better with the paid one.
Expose is also shipped with Laravel Herd, so I assume the behavior (when used via Herd) is the same.
There were a couple of comments in the expose GitHub repository that unsecuring a local domain may help. I haven’t tried that as for some reason I don’t want to work in http:// domains locally.
Localtunnel
According to authors, Localtunnel makes it simple to share a web service from your local development machine, without the hassle of configuring DNS or firewall settings.
It provides you with a unique, publicly accessible URL that directs all incoming requests to your local web server.
Here you can read more about the project.
This one is open-source, has no special treatment for WordPress sites, only for temporary local development.
There is no project development any more, and after reading several GH issues I decided not even trying it locally. There are some security-related reports.
Laravel Herd and Sharing Sites
You can read more in their official docs.
They support only expose. Herd is coming with expose already, and I really don’t see a reason why anyone should use Herd Share instead of Expose directly.
They also mention ngrok in their docs, but they just advise to use it directly, no special treatment or wrappers. So more on that below.
Valet by Laravel and the share
I actually use Valet locally, together with phpmon.
Valet has a share command (docs), and it supports (as of right now), 3 ways to expose the site:
cloudflared
This is a new one, shipped with valet v4.8.0, and is basically a tiny wrapper around cloudfrared by Cloudflare (who knew).
The main tool development is happening in this GitHub repo.
Official docs are very details and also very long. Frankly, that was too much for me to dive into.
It’s quite powerful but not very intuitive.
I haven’t tried a standalone tool, just via valet share – and that didn’t work.

Funny enough, Valet docs are outdated and don’t mention cloudflared. So I do believe that Valet is long gone into a maintenance mode.
Here is a lot more information about Cloudflare Tunnel in a podcast format, by the folks at Syntax.fm.
expose
Same as above by BeyondCode, but with even less configuration options.
ngrok
This one is broken. They have a wrapper around ngrok, but the ngrok API changed – but valet’s wrapper has not. So sharing sites doesn’t work anymore.
Ngrok
Last time when I mentioned it in my blog post about Expose, I said that it would be boring to constantly change the domain (which is ephemeral – meaning it changes all the time when you relaunch the tunnel).
Well, I still think it’s boring and cumbersome.
But since then, Expose v1 is no longer available, and the custom subdomain that you used to be able to set for free with it – is now part of the paid plan for their Expose v2. So this argument is no longer valid.
Ngrok has even a documentation article mentioning WordPress specifically which is really awesome.
And it actually works.
So, to sum up, ngrok:
- has a free tier which allows you to start the tunnel with random unique subdomains
- is fairly fast, around a second of extra time added to all requests
- has a local dashboard that lists all the requests coming to the than tunneled unique URL, with request/response data.
- has a monthly payment of $10 with 1 unique custom subdomain (which is better than a yearly $59 or whatever when using Expose) – so it’s cheaper when you need to run it for a month or two.
- it actually works out of the box after reading their 1 single doc article I shared above and adding 1 small code snippet to my
wp-config.php
So yeah, it looks like I’m adding this command to my toolkit:
ngrok http --host-header=rewrite https://example.test:443Code language: JavaScript (javascript)Featured image is “Architecture Tunnels” by Dominik Martin/ CC0 1.0.

Leave a Reply