Update README.md
Added an example of how to use a SOCKS proxy.
This commit is contained in:
parent
077a128006
commit
7e63518087
28
README.md
28
README.md
|
@ -235,6 +235,34 @@ You can also specify the language and logo for each channel individually, like s
|
||||||
>France 24</channel>
|
>France 24</channel>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## How to use SOCKS proxy?
|
||||||
|
|
||||||
|
First, you need to install [socks-proxy-agent](https://www.npmjs.com/package/socks-proxy-agent):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install socks-proxy-agent
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you can use it to create an agent that acts as a SOCKS proxy. Here is an example of how to do it with the Tor SOCKS proxy:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { SocksProxyAgent } = require('socks-proxy-agent')
|
||||||
|
|
||||||
|
const torProxyAgent = new SocksProxyAgent('socks://localhost:9050')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
site: 'example.com',
|
||||||
|
url: 'https://example.com/epg.json',
|
||||||
|
request: {
|
||||||
|
httpsAgent: torProxyAgent,
|
||||||
|
httpAgent: torProxyAgent
|
||||||
|
},
|
||||||
|
parser(context) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/freearhey/epg-grabber/issues) or a [pull request](https://github.com/freearhey/epg-grabber/pulls).
|
If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/freearhey/epg-grabber/issues) or a [pull request](https://github.com/freearhey/epg-grabber/pulls).
|
||||||
|
|
Loading…
Reference in New Issue