You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,8 @@ Use it when your dev server is running on a remote machine and you want to open
27
27
- Prints the HTTPS MagicDNS URL for the current Tailscale device.
28
28
- Supports an explicit `--port` when automatic detection is not possible.
29
29
- Supports `--tailscale-port` when you want the MagicDNS URL to include a specific HTTPS port.
30
-
- Detects Laravel + Vite dev output, exposes both servers, and rewrites Laravel's `public/hot` file to the Tailscale Vite URL.
30
+
- Detects Laravel + Vite dev output, exposes both servers, rewrites Laravel's `public/hot` file to the Tailscale Vite URL, and proxies Vite assets with CORS headers so module scripts can load cross-origin.
31
+
- Avoids overwriting an existing default Tailscale Serve mapping: if `https://<host>` is already serving another project, `lizardtail` chooses the first free `8443+` HTTPS port and prints that URL.
31
32
32
33
## Requirements
33
34
@@ -136,13 +137,13 @@ lizardtail --port 3000 npm run dev
136
137
137
138
### MagicDNS URL with an explicit port
138
139
139
-
By default, Tailscale Serve uses HTTPS port 443, so the URL has no port:
140
+
By default, Tailscale Serve uses HTTPS port 443, so the URL has no port when 443 is free or already points at the same local target:
140
141
141
142
```text
142
143
https://my-host.tailabc.ts.net
143
144
```
144
145
145
-
If you want a URL with a port, choose the Tailscale HTTPS port separately:
146
+
If port 443 is already serving another project, `lizardtail` automatically chooses the first free `8443+` port so multiple projects can be served at the same time. You can also choose the Tailscale HTTPS port explicitly:
Laravel development commands often start both the PHP app server and the Vite asset server. When `lizardtail` sees both, it:
160
161
161
162
1. exposes the Laravel app server;
162
-
2. exposes the Vite asset server on a separate Tailscale HTTPS port;
163
-
3. writes `public/hot` to the Tailscale Vite URL so Laravel renders assets from the reachable Vite server.
163
+
2. starts a small local proxy in front of Vite that adds CORS headers;
164
+
3. exposes that Vite proxy on a separate Tailscale HTTPS port;
165
+
4. writes `public/hot` to the Tailscale Vite URL so Laravel renders assets from the reachable Vite server.
164
166
165
167
```bash
166
168
lizardtail composer run dev
@@ -172,7 +174,7 @@ You can choose the Vite Tailscale port explicitly:
172
174
lizardtail --vite-tailscale-port 8453 composer run dev
173
175
```
174
176
175
-
`lizardtail` also sets `__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS` for the child command when it can read your Tailscale MagicDNS name. If browser assets still fail, your Vite config may also need CORS enabled, for example by running Vite with `--cors`.
177
+
`lizardtail` also sets `__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS` for the child command when it can read your Tailscale MagicDNS name. The local proxy handles CORS for module scripts loaded from the Vite Tailscale URL.
176
178
177
179
If your app server lands on a known port and you only want to expose that server, you can force it:
0 commit comments