{"id":20710035,"url":"https://github.com/oxylabs/puppeteer-proxy-integration-js","last_synced_at":"2025-09-07T08:43:35.386Z","repository":{"id":44763476,"uuid":"449199406","full_name":"oxylabs/puppeteer-proxy-integration-js","owner":"oxylabs","description":"A tutorial for implementing Oxylabs` Residential and Datacenter proxies with Puppeteer using JavaScript","archived":false,"fork":false,"pushed_at":"2025-06-26T08:23:55.000Z","size":25,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T09:31:25.734Z","etag":null,"topics":["github-proxy-list","headless","javascript","nodejs","proxy","proxy-list","proxy-list-github","proxy-rotator","proxy-site","puppeteer","puppeteer-demo","residential-proxy","rotating-proxy","socks5-proxy-list","socks5-server","socks5-server-java","web-proxy","webproxy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxylabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-18T08:22:31.000Z","updated_at":"2025-06-26T08:23:59.000Z","dependencies_parsed_at":"2025-04-23T05:05:08.573Z","dependency_job_id":"4d88f4ae-1ec8-49bc-ab7b-7179669e4673","html_url":"https://github.com/oxylabs/puppeteer-proxy-integration-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oxylabs/puppeteer-proxy-integration-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Fpuppeteer-proxy-integration-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Fpuppeteer-proxy-integration-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Fpuppeteer-proxy-integration-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Fpuppeteer-proxy-integration-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxylabs","download_url":"https://codeload.github.com/oxylabs/puppeteer-proxy-integration-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Fpuppeteer-proxy-integration-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274014658,"owners_count":25207687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-proxy-list","headless","javascript","nodejs","proxy","proxy-list","proxy-list-github","proxy-rotator","proxy-site","puppeteer","puppeteer-demo","residential-proxy","rotating-proxy","socks5-proxy-list","socks5-server","socks5-server-java","web-proxy","webproxy"],"created_at":"2024-11-17T02:09:37.698Z","updated_at":"2025-09-07T08:43:35.378Z","avatar_url":"https://github.com/oxylabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oxylabs' Proxy Integration with Puppeteer\n\n[![Oxylabs promo code](https://raw.githubusercontent.com/oxylabs/product-integrations/refs/heads/master/Affiliate-Universal-1090x275.png)](https://oxylabs.io/pages/gitoxy?utm_source=877\u0026utm_medium=affiliate\u0026groupid=877\u0026utm_content=puppeteer-proxy-integration-js-github\u0026transaction_id=102f49063ab94276ae8f116d224b67)\n\n[![](https://dcbadge.vercel.app/api/server/eWsVUJrnG5)](https://discord.gg/GbxmdGhZjq)\n\n[\u003cimg src=\"https://img.shields.io/static/v1?label=\u0026message=JavaScript\u0026color=brightgreen\" /\u003e](https://github.com/topics/javascript) [\u003cimg src=\"https://img.shields.io/static/v1?label=\u0026message=Web%20Scraping\u0026color=important\" /\u003e](https://github.com/topics/web-scraping) [\u003cimg src=\"https://img.shields.io/static/v1?label=\u0026message=Rotating%20Proxies\u0026color=blueviolet\" /\u003e](https://github.com/topics/rotating-proxies)\n- [Requirements](#requirements)\n- [Integrating Datacenter Proxies](#integrating-datacenter-proxies)\n- [Integrating Residential Proxies](#integrating-residential-proxies)\n## Requirements\n\n### Puppeteer\n```bash\nnpm install puppeteer\n```\n\n## Integrating Datacenter Proxies \n\n### Getting a List of Proxies\n\nOpen the following URL in the browser and enter your credentials. You will see a list of proxies in plain text:\n\n```\nhttps://proxy.oxylabs.io/all\n```\n\n### Using Proxies\n\nIf you wish to select any of the provided proxies, save the proxy IP, along with the port in a variable.\n\nTo use all these proxies, first, save these proxies as an array in your code:\n\n```javascript\nlet proxies = [\n    '127.0.0.1:60000',\n    '127.0.0.2:60000',\n    '127.0.0.3:60000',\n    '127.0.0.4:60000'\n  ]\n```\n\nTo select one of these proxies randomly, use the following line of code:\n\n```JavaScript\nvar proxy = proxies[Math.floor(Math.random() * proxies.length)];\n```\n\nThe proxy server you will use needs to be supplied as `--proxy-server` argument.\n\nCreate a variable that can contain all the arguments in an array.\n\nAdditionally, `launchOptions` can also contain other information, such as `headless` mode as following:\n\n```JavaScript\nconst launchOptions = {\n  // Set the proxy server to the server variable\n  args: ['--proxy-server=' + proxy],\n\n  // Set additional launch options here\n  headless: false\n};\n```\n\nAfter creating the `launchOptions` variable, create a `puppeteer` instance and launch the browser.\n\n```javascript\nconst browser = await puppeteer.launch(launchOptions);\n```\n\nFinally, to authenticate using your credentials, call the `page.authenticate` function after creating a `page`.\n\n```javascript\n// Create a new page\nconst page = await browser.newPage();\n\n// Set the username and password provided by Oxylabs\nawait page.authenticate({\n  username: 'USERNAME',\n  password: 'PASSWORD'\n});\n```\n\nFor the complete code sample, see [this file](datacenter_random.js).\n\n\n## Integrating Residential Proxies\n\n### Random Proxy Using the Proxy API\nTo get a random proxy, use the proxy server `pr.oxylabs.io:7777`.\n\nAs mentioned above, the proxy server you will use needs to be supplied as `--proxy-server` argument.\n\nCreate a variable that can contain all the arguments in an array.\n\nAdditionally, `launchOptions` can also contain other information, such as `headless` mode as following:\n\n```JavaScript\nconst launchOptions = {\n  // Set the proxy server to the server variable\n  args: ['--proxy-server=pr.oxylabs.io:7777']\n};\n```\n\nAfter creating the `launchOptions` variable, create a `puppeteer` instance and launch the browser.\n\n```javascript\nconst browser = await puppeteer.launch(launchOptions);\n```\n\nFinally, to authenticate using your credentials, call the `page.authenticate` function after creating a `page`.\n\n```javascript\n// Create a new page\nconst page = await browser.newPage();\n\n// Set the username and password provided by Oxylabs\nawait page.authenticate({\n  username: 'USERNAME',\n  password: 'PASSWORD'\n});\n```\n\nFor the complete code sample, see [this file](residential_random.js).\n\n### Country Specific Proxies\n\nIf you wish to use country-specific proxies, all you need to do is change the `proxy` server.\n\nFor example, if you want to use a proxy for the United States, you can use the following code:\n\n```javascript\nconst launchOptions = {\n  args: ['--proxy-server=us-pr.oxylabs.io:10001']\n};\n\n```\n\nIn this example, `us-pr.oxylabs.io:10000` is the country specific entry point for the United States.\n\nAnother example is `gb-pr.oxylabs.io:20000`, which is the country specific entry point for the United Kingdom.\n\nFor a complete list of all entry points, see [Country Specific Entry Nodes](https://oxy.yt/KrKF)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxylabs%2Fpuppeteer-proxy-integration-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxylabs%2Fpuppeteer-proxy-integration-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxylabs%2Fpuppeteer-proxy-integration-js/lists"}