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
{{ message }}
Repository navigation
Commit 384e47d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/api/class-browsertype.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -421,7 +421,11 @@ const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.
421
421
* since: v1.45
422
422
-`host` <[string]>
423
423
424
-
Host to use for the web socket. It is optional and defaults to `localhost`, accepting connections only from the loopback interface. Pass an explicit address (e.g. `0.0.0.0`) to accept connections from the network — be aware this exposes the browser RPC to anything that can reach the listening port.
424
+
Host to use for the web socket. It is optional and defaults to `localhost`, accepting connections only from the loopback interface. Pass an explicit address (e.g. `0.0.0.0`) to accept connections from the network.
425
+
426
+
:::warning
427
+
The Browser Server has no authentication. A client that can reach the listening port and knows the [`option: BrowserType.launchServer.wsPath`] gets full control of the browser and can act as the OS user that started the server. When you pass an explicit host, restrict access to the port with your network configuration, for example a firewall, a private network or an authenticating proxy. Do not rely on the `wsPath` alone.
428
+
:::
425
429
426
430
### option: BrowserType.launchServer.port
427
431
* since: v1.8
@@ -440,6 +444,10 @@ unguessable string.
440
444
Any process or web page (including those running in Playwright) with knowledge
441
445
of the `wsPath` can take control of the OS user. For this reason, you should
442
446
use an unguessable token when using this option.
447
+
448
+
The unguessable path protects a server on the loopback interface from web pages and
449
+
from other local processes. It is not a replacement for network access control: the path
450
+
is a part of the URL and is sent in plain text over `ws://`. See [`option: BrowserType.launchServer.host`].
The Playwright Server has no authentication. Any client that can reach the port gets full control of the browsers and can act as the user that runs the server. The server is intended to run in an environment where the network configuration restricts access to the port. Publish the port only to trusted clients, for example with `-p 127.0.0.1:3000:3000` when the tests run on the same machine, or with a firewall, a private network or an authenticating proxy otherwise.
125
+
126
+
If other local users or processes must not connect, for example on a shared development machine, serve the endpoint at an unguessable path with `--path /<secret>` and connect to `ws://127.0.0.1:3000/<secret>`.
test('BT-096 should not retain closed browsers in launch mode',{annotation: {type: 'issue',description: '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/microsoft/playwright/issues/43421'}},async({ connect })=>{
0 commit comments