mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 21:58:21 +01:00
feat: add a timeout option for http client (#2600)
This commit is contained in:
parent
8c18c02c65
commit
cce11964a4
@ -13,6 +13,7 @@
|
||||
timezone = "UTC"
|
||||
|
||||
[http]
|
||||
timeout = 60
|
||||
useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
|
||||
|
||||
[cache]
|
||||
|
@ -17,6 +17,7 @@ __Notice__: If a parameter is not specified in your `config.ini.php` RSS-Bridge
|
||||
The configuration file is split into sections:
|
||||
|
||||
* [system](#system)
|
||||
* [http client](#http client)
|
||||
* [cache](#cache)
|
||||
* [proxy](#proxy)
|
||||
* [authentication](#authentication)
|
||||
@ -25,6 +26,8 @@ The configuration file is split into sections:
|
||||
|
||||
_System_: This section specifies system specific parameters
|
||||
|
||||
_Http client_: This section has http client options
|
||||
|
||||
_Cache_: This section is all about the caching behavior of RSS-Bridge
|
||||
|
||||
_Proxy_: This section can be used to specify a proxy server for RSS-Bridge to utilize for fetching contents
|
||||
@ -98,6 +101,21 @@ Allow users to disable proxy usage for specific requests.
|
||||
|
||||
`false` = disabled (default)
|
||||
|
||||
## Http client
|
||||
|
||||
This section provides the following parameters:
|
||||
|
||||
- timeout
|
||||
- useragent
|
||||
|
||||
### timeout
|
||||
|
||||
Default network timeout.
|
||||
|
||||
### useragent
|
||||
|
||||
Default user agent.
|
||||
|
||||
## Authentication
|
||||
|
||||
This section provides following parameters:
|
||||
|
@ -169,6 +169,7 @@ function getContents($url, $header = array(), $opts = array(), $returnHeader = f
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, Configuration::getConfig('http', 'useragent'));
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, Configuration::getConfig('http', 'timeout'));
|
||||
curl_setopt($ch, CURLOPT_ENCODING, '');
|
||||
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user