From 0ac3cd2e06898509ad59bc6f1cea5c8a47fabc0d Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 17 Aug 2023 15:15:11 -0400 Subject: [PATCH] CURLOPT_PROXYTYPE docker --- docker/README.md | 1 + docker/attributes.sh | 1 + docker/php/config.php | 2 +- docker/php/php.dockerfile | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index e8d0899..4d944c7 100644 --- a/docker/README.md +++ b/docker/README.md @@ -130,6 +130,7 @@ This docker image was developed with high configurability in mind, so here is th |:----------|:-------------|:---------|:------| | CURLOPT_PROXY_ENABLED | false | boolean | If you want to use a proxy, you need to set this variable to true. | | CURLOPT_PROXY | "" | "127.0.0.1:8080" | Set the proxy using the ip and port to be used | +| CURLOPT_PROXYTYPE | "CURLPROXY_HTTP" | "CURLPROXY_SOCKS4A" "CURLPROXY_SOCKS5" "CURLPROXY_SOCKS5_HOSTNAME" | Set the type of proxy connection (if you enabled it). | | CURLOPT_RETURNTRANSFER | true | boolean | **TODO** | | CURLOPT_ENCODING | "" | string | Defines the encode that curl should use to display the texts correctly | | CURLOPT_USERAGENT | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" | string | This variable defines the 'User-Agent' that curl will use to attempt to avoid being blocked | diff --git a/docker/attributes.sh b/docker/attributes.sh index 8784ac7..db47c3d 100755 --- a/docker/attributes.sh +++ b/docker/attributes.sh @@ -53,6 +53,7 @@ export APP_BIBLIOREADS=${APP_BIBLIOREADS:-""} # Generally, a proxy is needed when your IP address is blocked by search engines in response to multiple requests within a short time frame. In these cases, it is recommended to use rotating proxies export CURLOPT_PROXY_ENABLED=${CURLOPT_PROXY_ENABLED:-false} export CURLOPT_PROXY=${CURLOPT_PROXY:-""} +export CURLOPT_PROXYTYPE=${CURLOPT_PROXYTYPE:-"CURLPROXY_HTTP"} export CURLOPT_RETURNTRANSFER=${CURLOPT_RETURNTRANSFER:-true} export CURLOPT_ENCODING=${CURLOPT_ENCODING:-""} export CURLOPT_USERAGENT="${CURLOPT_USERAGENT:-"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"}" diff --git a/docker/php/config.php b/docker/php/config.php index f305fe8..5cee38a 100644 --- a/docker/php/config.php +++ b/docker/php/config.php @@ -102,7 +102,7 @@ "curl_settings" => array( CURLOPT_PROXY => "${CURLOPT_PROXY}", - CURLOPT_PROXYTYPE => CURLPROXY_HTTP, + CURLOPT_PROXYTYPE => "${CURLOPT_PROXYTYPE}", CURLOPT_RETURNTRANSFER => ${CURLOPT_RETURNTRANSFER}, CURLOPT_ENCODING => "${CURLOPT_ENCODING}", CURLOPT_USERAGENT => "${CURLOPT_USERAGENT}", diff --git a/docker/php/php.dockerfile b/docker/php/php.dockerfile index e371b15..ec5dcc1 100644 --- a/docker/php/php.dockerfile +++ b/docker/php/php.dockerfile @@ -42,6 +42,7 @@ ENV APP_BIBLIOREADS="" # Generally, a proxy is needed when your IP address is blocked by search engines in response to multiple requests within a short time frame. In these cases, it is recommended to use rotating proxies ENV CURLOPT_PROXY_ENABLED=false ENV CURLOPT_PROXY="" +ENV CURLOPT_PROXYTYPE="CURLPROXY_HTTP" ENV CURLOPT_RETURNTRANSFER=true ENV CURLOPT_ENCODING="" ENV CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"