Rayrun
← Back to Discord Forum

How to ignore system proxy settings and set proxy to None?

As the title states, my system is Windows 10 and a global proxy is set, but I don’t want playwright to use this proxy. I don't want to use any proxy. I tried playwright.chromium.launch(proxy=None) but that didn't work. System proxy is still used. 😆

This thread is trying to answer question "How can I ignore system proxy settings and set proxy to None in Playwright on a Windows 10 system?"

2 replies

In new_page() or new_context() you can try to bypass the proxy https://playwright.dev/python/docs/api/class-browser#browser-new-page see the params

Answer

Disabling Proxy Settings in Playwright

If you're looking to bypass system proxy settings in Playwright on a Windows 10 system, you can do so by using the proxy option in Playwright's Test Library. This option allows you to specify the server as "none", effectively disabling any proxy settings.

Here's how you can do it in your playwright.config.ts file:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    proxy: {
      server: 'none',
    },
  },
});

By setting the server value to "none", Playwright will ignore any system-level or global proxy settings and establish direct connections without a proxy.

Remember, this configuration is specific to Playwright's Test Library. If you're using Playwright directly or with another testing framework, the approach may differ slightly. But the concept remains the same - setting the proxy.server value to "none" will disable any proxy settings.

When specifying a context-specific proxy for Chromium on Windows, it requires passing a non-empty value for proxy.server. In such cases, you can set it as "per-context" while also configuring your global options accordingly.

In short, by setting the proxy.server option as "none" in your Playwright configuration file, you can bypass system proxy settings and set the proxy to none on a Windows 10 system when using Playwright's Test Library.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].