Apps with an API on another port
A front end on one port that calls an API on another: name both, separated by a space. The link opens the first app; the others are reachable from it as they are on your machine, under the same link and the same tester sign-in.
$ purlview share 5173 8000 ✓ Sharing localhost:5173 + localhost:8000 https://k7m2p4qx.purlview.link/?token=Zk3vQ9x7Lm2Np5RtYw8AbC
Name up to 10 apps. purlview list shows the first app with +1 for each further one.
What is rewritten
In the text your apps send (HTML, JavaScript, CSS, JSON), an exact address of a listed app is translated for the tester: http://localhost:8000/api becomes an address under the share, and a ws:// address the same. An address inlined at build time, as from VITE_API_URL, is plain text and is translated. Cookies the API sets and WebSockets to it work as they do on your machine. Headers are translated too, so the API sees requests as it does on your machine.
What is not
A bare host:port with no scheme, and any port you did not name. A port you did not name stays unreachable through the share even when a response mentions it; the tester's browser resolves it against their own machine, as without Purlview.
The reload script
Hot reload reaches a page that reloads only once its new hot-reload connection is open, and through a share that takes as long as the page takes to load over the network. A change you save in that time would otherwise reach the tester with your next save. So for apps on Vite's dev server (Vite, Astro, SvelteKit, Nuxt, React Router), every page the tester opens also runs a small script from Purlview: once the page's hot-reload connection is open, it asks the share whether the app has changed since the page was sent, and if it has, reloads the page once. It sends nothing about the tester, contacts nothing but the share and loads no other code. Other dev servers behave as they always have. Your project is not changed, and neither is what your own browser tabs receive.
--no-rewrite
--no-rewrite leaves response bodies as your apps wrote them, for a share whose content the translation harms: Leave response bodies as the apps wrote them: no address translation in bodies and no reload script. Headers are still translated, so a redirect to a listed app still leads to the share, and every named app stays reachable.
When one app stops answering, the terminal names it, and says when it is back:
2:51 PM ! localhost:8000 stopped responding — visitors see a waiting page 2:51 PM ✓ localhost:8000 is responding again
Limits
- HTTP and HTTPS apps.
- Links last up to an hour.
- Service workers and addresses built at runtime are not supported.
- Vite and Next.js work with their default config. webpack-dev-server's default client opens its hot-reload socket at the development server's own port, which no share serves; pages load, but changes do not reach the tester.
- A further app is expected to be an API. A second app that serves pages whose links start with
/points them at the first app.