Sharing local sites
#

Expose 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 Expose.

Sharing the current working directory
#

To share the current working directory with Expose, all you need to do is go into the directory and call expose.

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.

Examples
#

# Share the local site "my-site.test" as "my-site.EXPOSE-SERVER"
~/Sites/my-site/ expose

# Share the local site "api.my-site.test" as "api-my-site.EXPOSE-SERVER"
~/Sites/api.my-site/ expose

If you are using the Expose network on the free plan, you get a random subdomain on every connect but you can upgrade to Expose Pro or Expose for Teams and use custom subdomains as if you'd host your own server.

Sharing a local site explicitly
#

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 expose share command and specify the domain directly.

This is required when sharing sites that have HTTPS locally or Expose can't map local directory names to URLs automatically.

# Share access to http://192.168.2.100
expose share http://192.168.2.100

# Share access to http://127.0.0.1:3000
expose share http://127.0.0.1:3000

# Share access to http://my-local-site.dev
expose share my-local-site.dev

# Share access to https://my-local-site.dev
expose share https://my-local-site.dev

Share a local site with specific subdomain PRO
#

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 Expose connect. Custom subdomains require an own Expose server in your infrastructure or Expose Pro.

To specify the subdomain, pass the --subdomain option to expose:

expose share my-site.test --subdomain=my-site

If someone already uses the chosen subdomain on the Expose server, you will see an error message and the Expose server closes the connection.

Share a site using a dedicated Expose server PRO
#

Aside from setting a specific subdomain during the connection, you can also set the Expose network note of the global network with the --server flag.

expose share my-site.test --subdomain=super-site --server=us-2