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]: Requests don't go through proxy on Windows #7698

Closed
szmarczak opened this issue Oct 17, 2021 · 11 comments
Closed

[Bug]: Requests don't go through proxy on Windows #7698

szmarczak opened this issue Oct 17, 2021 · 11 comments

Comments

@szmarczak
Copy link

szmarczak commented Oct 17, 2021

Bug description

Incognito context.

import {promisify} from 'util';
import http from 'http';
import puppeteer from 'puppeteer'; // puppeteer@10.4.0
import {Server as ProxyChainServer} from 'proxy-chain'; // proxy-chain@2.0.0-beta.0

const httpServer = http.createServer((request, response) => {
	response.end(request.socket.remoteAddress);
});

await promisify(httpServer.listen.bind(httpServer))(8080);

const server = new ProxyChainServer({
	port: 8888,
	prepareRequestFunction: (input) => {
		console.log('proxy: received authentication request');
		
		return {
			localAddress: '127.0.0.3',
			requestAuthentication: input.username !== 'foo' || input.password !== 'bar',
		};
	},
});

await server.listen();

const browser = await puppeteer.launch();

const context = await browser.createIncognitoBrowserContext({
      proxyServer: 'http://127.0.0.3:8888',
      proxyUsername: 'foo',
      proxyPassword: 'bar',
      proxyBypassList: ['<-loopback>'],
});

const page = await context.newPage();

await page.authenticate({
	username: 'foo',
	password: 'bar',
});

const response = await page.goto('http://127.0.0.1:8080');
const text = await response.text();

// Expected: 127.0.0.3
// Actual: 127.0.0.1
console.log(text);

await page.close();
await context.close();
await browser.close();
await server.close();

await promisify(httpServer.close.bind(httpServer))();

Expected output

proxy: received authentication request
127.0.0.3

Actual output

127.0.0.1

Additional information

It works fine on Linux.

Puppeteer version

10.4.0

Node.js version

v16.11.1

npm version

8.0.0

What operating system are you seeing the problem on?

Windows

Relevant log output

No response

@szmarczak szmarczak added the bug label Oct 17, 2021
@szmarczak
Copy link
Author

/cc @mnmkng

@stale
Copy link

stale bot commented Jun 23, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 23, 2022
@szmarczak
Copy link
Author

unstale

@stale stale bot removed the unconfirmed label Jun 25, 2022
@m4Nu2oo7
Copy link

m4Nu2oo7 commented Aug 2, 2022

I can confirm this issue.

@stale
Copy link

stale bot commented Oct 1, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Oct 1, 2022
@szmarczak
Copy link
Author

unstale

@stale stale bot removed the unconfirmed label Oct 3, 2022
@stale
Copy link

stale bot commented Dec 2, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Dec 2, 2022
@szmarczak
Copy link
Author

unstale

@stale stale bot removed the unconfirmed label Dec 2, 2022
@stale
Copy link

stale bot commented Feb 1, 2023

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Feb 1, 2023
@szmarczak
Copy link
Author

unstale

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 2, 2023

This issue has already been confirmed in #8820 and it is the result of the upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1310057. Closing to dedupe and reference the reports.

@OrKoN OrKoN closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants