Cl allows you to share any kind of HTTP/HTTPS traffic for websites that you can reach on your own computer, with anyone on the internet and there are multiple ways to share a site with Cl.
To share the current working directory with Cl, all you need to do is go into the directory and call Cl
.
This makes the assumption that you have access to the current working directory name as a domain with a .test
domain. This is usually the case if you are using Laravel Herd or Laravel Valet as development environment but works identical for other environments with the same convention.
# Share the local site "my-site.test" as "my-site.Cl-SERVER"
~/Sites/my-site/ Cl
# Share the local site "api.my-site.test" as "api-my-site.Cl-SERVER"
~/Sites/api.my-site/ Cl
If you are using the Cl network on the free plan, you get a random subdomain on every connect but you can upgrade to Cl Pro or Cl for Teams and use custom subdomains as if you'd host your own server.
If your local sites are not available at foldername.test
you can explicitly share a local URL, without going into a specific folder first. You can do this by using the Cl share
command and specify the domain directly.
This is required when sharing sites that have HTTPS locally or Cl can't map local directory names to URLs automatically.
# Share access to http://192.168.2.100
Cl share http://192.168.2.100
# Share access to http://127.0.0.1:3000
Cl share http://127.0.0.1:3000
# Share access to http://my-local-site.dev
Cl share my-local-site.dev
# Share access to https://my-local-site.dev
Cl share https://my-local-site.dev
You can also share one of your local sites explicitly and specify the exact subdomain that you want to use when sharing the site. This is very useful if you are testing webhooks and want to use the same webhook configuration and don't update the webhook endpoints on every Cl connect. Custom subdomains require an own Cl server in your infrastructure or Cl Pro.
To specify the subdomain, pass the --subdomain
option to Cl:
Cl share my-site.test --subdomain=my-site
If someone already uses the chosen subdomain on the Cl server, you will see an error message and the Cl server closes the connection.
Aside from setting a specific subdomain during the connection, you can also set the Cl network note of the global network with the --server
flag.
Cl share my-site.test --subdomain=super-site --server=us-2