olect/torcurl
Composer 安装命令:
composer require olect/torcurl
包简介
Curl wrapper utilizing tor proxy
README 文档
README
Fucx\TorCurl - Not a very complex thing, but very helpful curl wrapper utilizing Tor Proxy connection to be anonymous and for dynamically changing IP address.
Version:
1.0
Author:
Ole Chr. Thorsen post@olethorsen.no
Requirements:
- PHP 7.1 or greater
Description:
Fucx\TorCurl provides a curl wrapper that works together with Tor. The main functionality is to start a Tor process and to perform curl requests (GET|POST). This codepack is not perfect, but should be very helpful for those who wanna bypass ip-blocks when performing to many requests against a server. Please use with good intent. I take no responsibiliy for any misuse or damage caused by using this package and should be used with valid concent and at your own risk.
Setup
Make sure you have Tor installed with CLI support. See install instructions here for different OS.
Troubleshooting
You can always add verbose mode to the ProxyConfig for full verbose reporting.
$config = new ProxyConfig();
$config->verbose();
- ProxyNotExistException: Means that Tor didn't start and it can't connect to the proxy or the proxy configuration was wrong. Check your /torrc file for proper IP and Port
- ProxyConnectionException: Problem getting identity from Tor connection. You have Tor installed? Test terminal command
tor. - TorCurlExecutionException: Your curl request returned some errors. Error should be thrown.
- NotImplementedException: I just didn't care to implement it.
- SingeltonException: Basically what it says. You have to initialize the curl wrapper through the static
Curl::initmethod and notnew Curl - ProxyStartException: Problem starting proxy for some reason. Probably because of ProxyConfig parameter mismatch. Run verbose.
If you get SSL issues: $curl->ignoreSSL().
Also, if Tor suddenly stop working properly, run killall tor and try again.
Examples:
The source package comes with some examples of interacting with the
Tor Curl Wrapper. See the examples/ directory in the source package.
TODO: (I won't actually ever do this, so feel free to fork and do)
- Refactor the entire shit to look more tech savvy
- Implement all request methods that I didn't give a fucx about
Copyright
Copyright (c) 2022 Ole Chr. Thorsen All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
olect/torcurl 适用场景与选型建议
olect/torcurl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「curl」 「tor」 「anonynimity」 「onion」 「tor client」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 olect/torcurl 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 olect/torcurl 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 olect/torcurl 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Classes for interacting with Tor over the control protocol, querying directory authorities and servers, DNS exit lists, a curl wrapper that makes it easy to use Tor's SOCKS proxy, and more.
This Guzzle middleware allows to use Tor client as a proxy
cURL and cURL based Soap-Client for PHP
Simple cURL wrapper
A fluent PHP CURL wrapper
IPQualityScore API for PHP
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-01-10