Sharing on your local network
#

Expose can share a site with devices on your local network, like your phone, a tablet or a colleague's laptop on the same Wi-Fi, without a tunnel. Your computer serves the site itself: there is no Expose server in between, so you don't need an account, a login or an internet connection.

Add the --lan option when you share a site:

expose share my-site.test --lan

Expose shows the address that other devices on your network can open:

Shared site              http://my-site.test
Dashboard                http://127.0.0.1:4040
LAN URL                  http://192.168.1.23:8080

Local network sharing needs the native Expose client, version 4.2 or later. See Installation.

What works the same as a tunnel
#

A local network share works like a share through the Expose network:

  • The request dashboard and the request log show every request, and you can replay them.
  • Password protection with --basicAuth works.
  • Shared Laravel sites keep working with Vite's dev server, hot reloading included, and local URLs in responses are rewritten to the LAN URL.
  • expose in a project directory, expose catch-all and expose share-port take --lan too.

Choosing a port
#

By default, Expose listens on port 8080, or on any free port if 8080 is already taken. Pass a port to use a specific one:

expose share my-site.test --lan=9000

Show a QR code
#

Add --qr-code to show a QR code of the LAN URL in your terminal, so you can open the site on your phone by scanning it:

expose share my-site.test --lan --qr-code

Sharing a port
#

expose share-port with --lan passes every TCP connection on the shared port to a local port, for services that don't speak HTTP:

expose share-port 3306 --lan

Security
#

Everyone on your local network can open a local network share, so be careful on public or shared Wi-Fi. Protect the share with a password when other people use the network:

expose share my-site.test --lan --basicAuth="user:password"

Local network shares use plain HTTP. Browsers only allow some features, like the camera, the clipboard and service workers, on HTTPS pages or on localhost. To test those on another device, share the site through the Expose network instead, which gives you an HTTPS URL.

If other devices can't connect, check that they are on the same network and that your computer's firewall allows incoming connections for expose.