puppeteer-page-proxy
Advanced tools
Comparing version 1.2.9 to 1.3.0
# Change log | ||
### [1.3.0] - 2022-11-03 | ||
#### Changes | ||
- Update readme | ||
- Update code for v6.2.0 of "socks-proxy-agent" | ||
# Change log | ||
### [1.2.9] - 2022-10-10 | ||
@@ -3,0 +8,0 @@ #### Fixes |
{ | ||
"name": "puppeteer-page-proxy", | ||
"description": "Additional Node.js module to use with 'puppeteer' for setting proxies per page basis.", | ||
"version": "1.2.9", | ||
"version": "1.3.0", | ||
"author": "Cuadrix <cuadrix12000@gmail.com> (https://github.com/Cuadrix)", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/Cuadrix/puppeteer-page-proxy", |
@@ -0,5 +1,9 @@ | ||
![npm](https://img.shields.io/npm/v/puppeteer-page-proxy?style=flat-square) | ||
![node-current](https://img.shields.io/node/v/puppeteer?style=flat-square) | ||
![npm](https://img.shields.io/npm/dt/puppeteer-page-proxy?style=flat-square) | ||
# puppeteer-page-proxy <img src="https://i.ibb.co/kQrN9QJ/puppeteer-page-proxy-logo.png" align="right" width="150" height="150"> | ||
Additional Node.js module to use with **[puppeteer](https://www.npmjs.com/package/puppeteer)** for setting proxies per page basis. | ||
Forwards intercepted requests from the browser to Node.js where it handles the request then returns the response to the browser, changing the proxy as a result. | ||
Forwards intercepted requests from the browser to Node.js where it redoes the requests through a proxy and then returns the response to the browser. | ||
@@ -18,3 +22,3 @@ ## Features | ||
## API | ||
#### PageProxy(pageOrReq, proxy) | ||
#### useProxy(pageOrReq, proxy) | ||
@@ -26,5 +30,5 @@ - `pageOrReq` <[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> 'Page' or 'Request' object to set a proxy for. | ||
`url`, `method`, `postData`, `headers`\ | ||
See [httpRequest.continue](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestcontinueoverrides) for more info about the above properties. | ||
See [ContinueRequestOverrides](https://pptr.dev/api/puppeteer.continuerequestoverrides) for more info about the above properties. | ||
#### PageProxy.lookup(page[, lookupService, isJSON, timeout]) | ||
#### useProxy.lookup(page[, lookupService, isJSON, timeout]) | ||
@@ -64,5 +68,5 @@ - `page` <[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> 'Page' object to execute the request on. | ||
``` | ||
The request object itself is passed as the first argument. The proxy can now be changed every request. | ||
The request object itself is passed as the first argument. The individual request will be tunneled through the specified proxy. | ||
Using it along with other interception methods: | ||
Using it together with other interception methods: | ||
```js | ||
@@ -95,3 +99,3 @@ await page.setRequestInterception(true); | ||
**NOTE:** It is necessary to set [page.setRequestInterception](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagesetrequestinterceptionvalue) to true when setting proxies per request, otherwise the function will fail. | ||
**NOTE:** It's necessary to set [Page.setRequestInterception()](https://pptr.dev/api/puppeteer.page.setrequestinterception) to true when setting proxies per request, otherwise the function will fail. | ||
@@ -128,3 +132,3 @@ #### Authenticating: | ||
This happens when there is an attempt to handle the same request more than once. An intercepted request is handled by either [httpRequest.abort](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestaborterrorcode), [httpRequest.continue](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestcontinueoverrides) or [httpRequest.respond](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestrespondresponse) methods. Each of these methods 'send' the request to its destination. A request that has already reached its destination cannot be intercepted or handled. | ||
This happens when there is an attempt to handle the same request more than once. An intercepted request is handled by either [HTTPRequest.abort()](https://pptr.dev/api/puppeteer.httprequest.abort), [HTTPRequest.continue()](https://pptr.dev/api/puppeteer.httprequest.continue) or [HTTPRequest.respond()](https://pptr.dev/api/puppeteer.httprequest.respond) methods. Each of these methods 'send' the request to its destination. A request that has already reached its destination cannot be intercepted or handled. | ||
@@ -149,3 +153,3 @@ | ||
``` | ||
You can think of the warning as a false positive. | ||
The warning can be thought of as a false positive. | ||
@@ -152,0 +156,0 @@ ## Dependencies |
const HttpProxyAgent = require("http-proxy-agent"); | ||
const HttpsProxyAgent = require("https-proxy-agent"); | ||
const SocksProxyAgent = require("socks-proxy-agent"); | ||
const { SocksProxyAgent } = require("socks-proxy-agent"); | ||
@@ -39,2 +39,2 @@ // Set some extra headers because Puppeteer doesn't capture all request headers | ||
module.exports = {setHeaders, setAgent}; | ||
module.exports = {setHeaders, setAgent}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26650
369
156