Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: launchServer bind hostname or address #30998

Closed
cavivie opened this issue May 24, 2024 · 0 comments · Fixed by #30999
Closed

[Feature]: launchServer bind hostname or address #30998

cavivie opened this issue May 24, 2024 · 0 comments · Fixed by #30999
Labels

Comments

@cavivie
Copy link
Contributor

cavivie commented May 24, 2024

🚀 Feature Request

I really like the server method that playwright provides so that I can remotely control the test nodes. Currently, I can use docker to start a playwright server and expose ports to a control node playwright client for testing. In contrast, when I run playwright server directly without docker, I am only able to get the ws url of localhost, which prevents me from connecting to it directly through other control nodes within a connectable network.

Example

const { chromium, webkit, firefox } = require('playwright');  // Or 'webkit' or 'firefox'.

(async () => {
  [chromium, webkit, firefox].forEach(async browserType => {
    const browserServer = await browserType.launchServer({
      // host: "0.0.0.0", // unsupported yet
      // port: 55432,
      // wsPath: "",
    });
    const wsEndpoint = browserServer.wsEndpoint();
    console.log(wsEndpoint, "for", browserType.name());
  })
  // Close browser instance.
  // await browserServer.close();
})();

Motivation

Improve API usability and playability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants