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

[BUG] IP:PORT Proxy doesnt work on playwright-firefox #3233

Closed
sentoxaio opened this issue Jul 30, 2020 · 8 comments · Fixed by #3568
Closed

[BUG] IP:PORT Proxy doesnt work on playwright-firefox #3233

sentoxaio opened this issue Jul 30, 2020 · 8 comments · Fixed by #3568
Assignees

Comments

@sentoxaio
Copy link

  • Playwright Version: ^1.2.1
  • Operating System: Windows
  • Node.js version: v14.1.0.
  • Browser: Firefox

Code Snippet

options.proxy = {
	server: "<port>:<ip>",
};

await firefox.launch(options)

Orginal Error:
image
It seems like that ip:port proxies don't work with playwright-firefox.

When you put http:// before it the browser starts, but throws
this error:
image

@aslushnikov
Copy link
Contributor

aslushnikov commented Aug 5, 2020

@sentoxaio the following works for me (with my personal proxy):

const {chromium, webkit, firefox} = require('playwright');

(async () => {
  const browser = await firefox.launch({
    headless: false,
    proxy: {
      server: 'http://40.112.209.181:3128',
      username: process.env.PROXY_USERNAME,
      password: process.env.PROXY_PASSWORD,
    },
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
})();

Maybe something else is going wrong?

@aslushnikov aslushnikov removed the v1.3 label Aug 5, 2020
@sentoxaio
Copy link
Author

@aslushnikov I am talking about proxies without an authentication (password & username).

@FoonkG
Copy link

FoonkG commented Aug 8, 2020

Indeed, proxies with user:pass authentication work well on playwright-firefox but proxies without user:pass authentication don't.

@aslushnikov
Copy link
Contributor

@sentoxaio, @FoonkG: I tried with a local charles proxy running on localhost:8888 - worked fine:

The script with playwright v1.3.0:

const {chromium, webkit, firefox} = require('playwright');

(async () => {
  const browser = await firefox.launch({
    headless: false,
    proxy: {
      server: 'http://127.0.0.1:8888'
    },
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
})();

Any more details to help me reproduce this?

@aslushnikov
Copy link
Contributor

FYI: current playwright@next has a new proxy implementation for Firefox, so please give it a try - maybe it'll fix things on your end

@pavlealeksic
Copy link

The problem also might be not adding http:// in front of the proxy ip:port

@aslushnikov
Copy link
Contributor

Yeah, protocol is pretty important! This way you can specify both regular (HTTP) and Secure (HTTPS) web proxies.

@aslushnikov
Copy link
Contributor

Ah, now I understand! We have a shortform in the documentation that doesn't actually work for firefox. We'll fix this.

aslushnikov added a commit to aslushnikov/playwright that referenced this issue Aug 21, 2020
Short notation implies `http://` scheme.

Fixes microsoft#3233
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Aug 28, 2020
Short notation implies `http://` scheme.

Fixes microsoft#3233
aslushnikov added a commit that referenced this issue Aug 28, 2020
Short notation implies `http://` scheme.

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

Successfully merging a pull request may close this issue.

5 participants