From 7e63518087156a6bd155f3e8f9c0ee01215e2673 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 18 Apr 2023 02:38:21 +0300 Subject: [PATCH] Update README.md Added an example of how to use a SOCKS proxy. --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 63afbfd..5621031 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,34 @@ You can also specify the language and logo for each channel individually, like s >France 24 ``` +## 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).