Proxy support

This commit is contained in:
Pablo Ferreiro 2022-09-03 13:21:43 +02:00
parent af4d98b8dd
commit 96fb2fd428
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
4 changed files with 28 additions and 8 deletions

View file

@ -14,3 +14,9 @@
# JSON cache, used on Helpers\CacheEngines\JSONCache
# API_CACHE_JSON=/tmp/proxitok_api # Path for JSON API Cache, leave commented for ./cache/api
# Proxy Config
# PROXY_HOST=http://EXAMPLE_IP # Host to be used as proxy, make sure to type a valid protocol. Available: http:// | https:// | socks4:// | socks5://
# PROXY_PORT=8080
# PROXY_USERNAME=username
# PROXY_PASSWORD=password

View file

@ -71,6 +71,20 @@ class Wrappers {
'close_when_done' => false
]
];
// -- PROXY CONFIG -- //
$proxy_host = Misc::env('PROXY_HOST', '');
$proxy_port = Misc::env('PROXY_PORT', '');
if ($proxy_host && $proxy_port) {
$options['proxy'] = [
'host' => $proxy_host,
'port' => $proxy_port,
'username' => Misc::env('PROXY_USERNAME', null),
'password' => Misc::env('PROXY_PASSWORD', null)
];
}
// Cache config
$cacheEngine = null;
if (isset($_ENV['API_CACHE'])) {

View file

@ -1,7 +1,7 @@
{
"name": "pablouser1/proxitok",
"description": "An alternative frontend for TikTok",
"version": "2.4.0.0",
"version": "2.4.1.0",
"license": "AGPL-3.0-or-later",
"type": "project",
"authors": [

14
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "521fa35e5864d7a4542823e1f4838018",
"content-hash": "a7e4990ac4c1935a8cdc93939bf26dc9",
"packages": [
{
"name": "bramus/router",
@ -263,16 +263,16 @@
},
{
"name": "pablouser1/tikscraper",
"version": "v2.2.1.0",
"version": "v2.2.1.1",
"source": {
"type": "git",
"url": "https://github.com/pablouser1/TikScraperPHP.git",
"reference": "53024570fe8a0258d911e5a245fe582090739a19"
"reference": "535ed6db108c9a0ec41b271bea8a6a10700cc5d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/53024570fe8a0258d911e5a245fe582090739a19",
"reference": "53024570fe8a0258d911e5a245fe582090739a19",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/535ed6db108c9a0ec41b271bea8a6a10700cc5d7",
"reference": "535ed6db108c9a0ec41b271bea8a6a10700cc5d7",
"shasum": ""
},
"require": {
@ -304,9 +304,9 @@
"description": "Get data from TikTok API",
"support": {
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.2.1.0"
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.2.1.1"
},
"time": "2022-08-17T12:43:32+00:00"
"time": "2022-09-03T11:19:59+00:00"
},
{
"name": "php-webdriver/webdriver",