Closed RobertBoes closed 9 months ago
Nice! Looks good to me.
This PR would improve our QoL by a ton.
Currently we have to run the valet proxy 5 times (once for each (sub)domain) when starting Octane and run valet unproxy 5 times again when stopping octane. Each command triggers a security prompt on Mac and takes some time to execute.
Reducing this to one proxy/unproxy call per time would be really neat!
Fantastic--what a great PR! Thank you!
This PR adds support for proxying multiple domains at once with a comma separated list of domains, such as
valet proxy my-domain,sub.my-domain http://127.0.0.1:8000
The change is backwards compatible, since I explode the URL by comma, if there's no comma present it works as before.
Reason for this change is working locally with Octane can be a bit frustrating. We have an app that uses multiple domains and we use Valet to proxy those domains to Octane. However, currently we'd have to run these commands:
This not only takes a long time, Valet also restarts nginx after each command, prompting for the sudo password every time. With this change it can be done in a single command, is much faster and only restarts nginx once;
It also includes the
unproxy
commandAnd this will also work if you proxied
domain,api.domain
and then runvalet unproxy api.domain
, as it will only unproxy theapi.domain
and keep thedomain
proxy