You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional Node.js module to use with **[puppeteer](https://www.npmjs.com/package/puppeteer)** for setting proxies per page basis.
3
7
4
-
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.
8
+
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.
5
9
6
10
## Features
7
11
@@ -15,16 +19,16 @@ Forwards intercepted requests from the browser to Node.js where it handles the r
15
19
npm i puppeteer-page-proxy
16
20
```
17
21
## API
18
-
#### PageProxy(pageOrReq, proxy)
22
+
#### useProxy(pageOrReq, proxy)
19
23
20
24
-`pageOrReq` <[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> 'Page' or 'Request' object to set a proxy for.
21
25
-`proxy` <[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> Proxy to use in the current page.
22
26
* Begins with a protocol (e.g. http://, https://, socks://)
23
27
* In the case of [proxy per request](https://github.com/Cuadrix/puppeteer-page-proxy#proxy-per-request), this can be an object with optional properties for overriding requests:\
24
28
`url`, `method`, `postData`, `headers`\
25
-
See [httpRequest.continue](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestcontinueoverrides) for more info about the above properties.
29
+
See [ContinueRequestOverrides](https://pptr.dev/api/puppeteer.continuerequestoverrides) for more info about the above properties.
**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.
96
+
**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.
93
97
94
98
#### Authenticating:
95
99
```js
@@ -121,7 +125,7 @@ It takes over the task of requesting content **from** the browser to do it inter
121
125
122
126
#### Why am I getting _"Request is already handled!"_?
123
127
124
-
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.
128
+
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.
125
129
126
130
127
131
#### Why does the browser show _"Your connection to this site is not secure"_?
@@ -141,7 +145,7 @@ connection: TLSSocket {
141
145
encrypted: true,
142
146
}
143
147
```
144
-
You can think of the warning as a false positive.
148
+
The warning can be thought of as a false positive.
0 commit comments