Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuadrix authored Feb 9, 2020
1 parent 54b753a commit 7650c67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ npm i puppeteer-page-proxy
- `pageOrReq` <[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> 'Page' or 'Request' object to set a proxy for.
- `proxy` <[string](https://developer.mozilla.org/en-US/docs/Glossary/String)> Proxy to use in the current page.
* Begins with a protocol (e.g. http://, https://, socks://)

#### PageProxy.lookup(page[, lookupService, isJSON, timeout])

- `page` <[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> 'Page' object to execute the request on.
Expand Down Expand Up @@ -56,7 +56,7 @@ const useProxy = require('puppeteer-page-proxy');
await page2.goto(site);
})();
```
#

#### Proxy per request:
```js
const puppeteer = require('puppeteer');
Expand Down Expand Up @@ -94,12 +94,12 @@ Since all requests can be handled exactly once, it's not possible to call other

**NOTE:** It is necessary to set [page.setRequestInterception](https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pagesetrequestinterceptionvalue) to true when setting proxies this way, otherwise the function will fail.

#

#### Authentication:
```js
const proxy = 'https://login:pass@host:port';
```
#

#### Lookup IP used by proxy:
```js
const puppeteer = require('puppeteer');
Expand Down Expand Up @@ -128,6 +128,7 @@ const useProxy = require('puppeteer-page-proxy');
await page2.goto(site);
})();
```

## Dependencies
- [Got](https://github.com/sindresorhus/got)
- [http-proxy-agent](https://github.com/TooTallNate/node-http-proxy-agent)
Expand Down

0 comments on commit 7650c67

Please sign in to comment.