forked from kkoooqq/fakebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo4-proxy.js
28 lines (23 loc) · 824 Bytes
/
demo4-proxy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const {FakeBrowser} = require('fakebrowser');
!(async () => {
// https://hideip.me/en/proxy/socks5list
const builder = new FakeBrowser.Builder()
.displayUserActionLayer(true)
.proxy({
// socks5://ip:port
// http://ip:port
// https://ip:port
proxy: 'socks5://213.183.32.155:53335',
exportIP: '213.183.32.155',
})
.vanillaLaunchOptions({
headless: false,
})
.userDataDir('./fakeBrowserUserData');
const fakeBrowser = await builder.launch();
const page = await fakeBrowser.vanillaBrowser.newPage();
await page.goto('https://whoer.net');
// ***** Do something automatic *****
// Don't forget to close your browser to release resources
await fakeBrowser.shutdown();
})();