GuidesUsing Endform
Test against a local server
Run your Playwright suite on Endform against an app running on your laptop, in a CI job, or inside a private network.
Endform runs your Playwright tests on remote browsers in Endform's cloud and reaches localhost and private networks over encrypted peer-to-peer tunnels through the Endform CLI — whether the CLI runs on your laptop, in a CI job, or on a machine connected to a VPN. If your playwright.config.ts already defines a webServer, Endform sets this tunnel up automatically with no extra configuration; for already-running servers, private hosts, or local databases, a few lines in endform.config.ts tell Endform which traffic to route through the CLI.
You need a Playwright suite connected to Endform (see Quickstart) and a local or private server your machine can reach.
Working with a coding agent? Give it this prompt and it will configure local proxying for you:
Configure this Playwright project to test against our local server on Endform by following https://endform.dev/docs/using-endform/local-server.md.
Run the suite on Endform and confirm requests reach the local server.How traffic reaches your server


Only requests matching your webServer or configured hosts and ports travel through the CLI. Traffic to public domains — such as CDNs, fonts, or third-party APIs — goes directly from the remote browsers to the internet.
The Endform CLI establishes outbound, encrypted, hole-punched peer-to-peer connections using iroh. You do not need to expose a public URL, change firewall rules, or run a separate tunnel such as ngrok. The tunnel exists only for the duration of the run (or live test session) and closes as soon as the CLI exits.
Configure your local target
Pick the option that matches how your server runs:
If your playwright.config.ts defines a webServer (or an array of servers), no extra Endform configuration is needed. Endform runs webServer locally on the machine running the CLI, omits it on the remote runners, and automatically proxies traffic for its host and port.
import { defineConfig } from "@playwright/test";
export default defineConfig({
webServer: {
command: "npm run dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
use: {
baseURL: "http://localhost:3000",
},
});If your app starts outside Playwright — in another terminal, with Docker Compose, or behind a corporate VPN — list its hosts in proxyNetworkHosts inside endform.config.ts (install endform as a dev dependency if it is not already in your package.json):
import { defineEndformConfig } from "endform";
export default defineEndformConfig({
proxyNetworkHosts: ["<loopback>", "*.staging.internal"],
});Each rule can be:
"<loopback>"— matcheslocalhost,*.localhost,127.0.0.1, and[::1]on any port.- A hostname or wildcard pattern, optionally scoped to a port — such as
"api.local","*.internal.company.com", or"localhost:3000". - An IP address — such as
"127.0.0.1".
proxyNetworkHosts intercepts HTTP and HTTPS traffic in both the browser and Node.js (request fixtures, fetch, and test helpers).
If your tests connect directly to non-HTTP services on 127.0.0.1 — such as Postgres or Redis for seeding or assertions — forward those loopback ports with proxyNetworkPorts:
import { defineEndformConfig } from "endform";
export default defineEndformConfig({
proxyNetworkHosts: ["<loopback>"],
proxyNetworkPorts: [5432, 6379],
});You can combine proxyNetworkHosts and proxyNetworkPorts in the same config.
Run and check that it worked
-
Start your server
Skip this step if Playwright starts the server via
webServer. Otherwise, make sure the app or internal host is reachable from the machine running the CLI. -
Run your suite on Endform
npx endform@latest test -
Verify traffic reached your server
Watch your local server's logs for incoming requests while the run executes, then open the dashboard link printed by the CLI. Every test should pass and show your local app in its replay.
Keep your local server healthy under parallel load
Endform schedules every test on its own remote machine at the same time, so a 50-test suite sends 50 browsers to your single local server simultaneously. A single-threaded dev server (such as next dev or vite) or a small CI runner can start timing out under that burst.
-
Cap concurrency if your server saturates. Add
concurrentTestLimitsinendform.config.tsto match what your local server can serve cleanly:endform.config.ts import { defineEndformConfig } from "endform"; export default defineEndformConfig({ proxyNetworkHosts: ["<loopback>"], concurrentTestLimits: [{ scope: "within-suite-run", limit: 10 }], }); -
Use a production build in CI. When running a local server inside a CI job, build and start the production server (
npm run build && npm run start) instead of a dev server with hot reloading. It handles concurrent requests faster and matches production behavior. -
Keep local dev and deployed CI working in one config. Read
BASE_URLwhen CI targets a staging or preview deployment, and startwebServeronly whenBASE_URLis unset:playwright.config.ts import { defineConfig } from "@playwright/test"; export default defineConfig({ webServer: process.env.BASE_URL ? undefined : { command: "npm run dev", url: "http://localhost:3000", reuseExistingServer: true, }, use: { baseURL: process.env.BASE_URL ?? "http://localhost:3000", }, });
When to use a deployed environment instead
Proxying through the CLI is a fast way to iterate locally, test an app started inside a CI job, or reach internal hosts behind a VPN. Once your suite grows or you want full speed on every pull request, a deployed staging or preview environment is usually a better fit:
| Local server proxy | Deployed staging or preview | |
|---|---|---|
| Setup | Zero infrastructure; works with webServer or proxyNetworkHosts | Needs a deployed URL or preview integration (Vercel, Netlify) |
| Parallelism | Bounded by your laptop or CI runner's CPU and memory | Scales cleanly to full suite parallelism |
| Latency | Extra round-trip from remote runners through the CLI machine | Direct connection from remote runners to your app |
| Best fit | Local iteration, CI-local Docker/app stacks, private/VPN hosts | Pull-request checks and large suites |
Run your Playwright suite on Endform from GitHub Actions or another CI provider.
Test Vercel previewsRun your suite automatically against every pull request's preview deployment.
endform.config.tsFull reference for proxyNetworkHosts, proxyNetworkPorts, and concurrentTestLimits.
Tune concurrency limits and remove bottlenecks when tests hit shared servers.
Last updated