Update README.md

Added an example of how to use a SOCKS proxy.
This commit is contained in:
Aleksandr Statciuk 2023-04-18 02:38:21 +03:00 committed by GitHub
parent 077a128006
commit 7e63518087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -235,6 +235,34 @@ You can also specify the language and logo for each channel individually, like s
>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
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).