php-proxy
=========
Proxy script built on PHP, Symfony and cURL.
This library borrows ideas from Glype, Jenssegers proxy, and Guzzle.
PHP-Proxy Web Application
-------
If you're looking for a **project** version of this script that functions as a Web Application similar to Glype, then visit
[**php-proxy-app**](https://github.com/Athlon1600/php-proxy-app)
See this php-proxy in action:
<a href="https://unblockvideos.com/" target="_blank">UnblockVideos.com</a>
Installation
-------
Install it using [Composer](http://getcomposer.org):
```bash
composer require athlon1600/php-proxy
```
Example
--------
```php
require('vendor/autoload.php');
use Proxy\Http\Request;
use Proxy\Proxy;
$request = Request::createFromGlobals();
$proxy = new Proxy();
$proxy->getEventDispatcher()->addListener('request.before_send', function($event){
$event['request']->headers->set('X-Forwarded-For', 'php-proxy');
});
$proxy->getEventDispatcher()->addListener('request.sent', function($event){
if($event['response']->getStatusCode() != 200){
die("Bad status code!");
}
});
$proxy->getEventDispatcher()->addListener('request.complete', function($event){
$content = $event['response']->getContent();
$content .= '<!-- via php-proxy -->';
$event['response']->setContent($content);
});
$response = $proxy->forward($request, "http://www.yahoo.com");
// send the response back to the client
$response->send();
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的谷歌镜像PHP虚拟主机版.zip (92个子文件)
132690142563907696
url
index.php 45B
link.php 590B
plugins
TestPlugin.php 723B
UrlFormPlugin.php 989B
config.php 524B
composer.json 465B
templates
main.php 104B
url_form.php 1KB
vendor
athlon1600
php-proxy
src
Html.php 5KB
Proxy.php 5KB
Event
ProxyEvent.php 691B
helpers.php 7KB
Config.php 759B
Plugin
AbstractPlugin.php 2KB
HeaderRewritePlugin.php 2KB
CookiePlugin.php 4KB
LogPlugin.php 895B
StreamPlugin.php 2KB
GooglePlugin.php 1KB
TwitterPlugin.php 553B
PseudostaticPlugin.php 625B
ProxifyPlugin.php 5KB
DailyMotionPlugin.php 992B
Redis.php 484B
Http
ParamStore.php 2KB
Request.php 9KB
Response.php 3KB
composer.json 444B
.git
index 2KB
HEAD 23B
refs
heads
master 41B
tags
remotes
composer
master 41B
origin
HEAD 32B
objects
pack
pack-abdb43aa5020a7376c3625a66e72f918b6812cc4.pack 474KB
pack-abdb43aa5020a7376c3625a66e72f918b6812cc4.idx 23KB
info
description 73B
packed-refs 320B
FETCH_HEAD 114B
info
exclude 240B
logs
HEAD 355B
refs
heads
master 186B
remotes
composer
master 159B
origin
HEAD 186B
hooks
post-update.sample 189B
prepare-commit-msg.sample 1KB
commit-msg.sample 896B
update.sample 4KB
pre-commit.sample 2KB
pre-rebase.sample 5KB
applypatch-msg.sample 452B
pre-applypatch.sample 398B
ORIG_HEAD 41B
config 437B
branches
.gitignore 35B
README.md 1KB
composer
installed.json 3KB
autoload_namespaces.php 149B
ClassLoader.php 12KB
LICENSE 1KB
autoload_files.php 240B
autoload_real.php 2KB
autoload_psr4.php 305B
autoload_classmap.php 147B
symfony
event-dispatcher
ImmutableEventDispatcher.php 2KB
phpunit.xml.dist 835B
LICENSE 1KB
EventDispatcher.php 6KB
composer.json 1KB
CHANGELOG.md 696B
DependencyInjection
RegisterListenersPass.php 4KB
ContainerAwareEventDispatcher.php 6KB
EventDispatcherInterface.php 3KB
GenericEvent.php 4KB
.gitignore 34B
Event.php 3KB
Debug
TraceableEventDispatcher.php 11KB
TraceableEventDispatcherInterface.php 803B
WrappedListener.php 2KB
README.md 610B
EventSubscriberInterface.php 2KB
Tests
ImmutableEventDispatcherTest.php 3KB
AbstractEventDispatcherTest.php 14KB
DependencyInjection
RegisterListenersPassTest.php 7KB
EventDispatcherTest.php 509B
EventTest.php 2KB
GenericEventTest.php 3KB
Debug
TraceableEventDispatcherTest.php 8KB
ContainerAwareEventDispatcherTest.php 8KB
autoload.php 183B
index.php 3KB
composer.lock 4KB
link.php 590B
共 92 条
- 1
资源评论
助力毕业
- 粉丝: 2192
- 资源: 5189
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于C语言的系统服务框架.zip
- (源码)基于Spring MVC和MyBatis的选课管理系统.zip
- (源码)基于ArcEngine的GIS数据处理系统.zip
- (源码)基于JavaFX和MySQL的医院挂号管理系统.zip
- (源码)基于IdentityServer4和Finbuckle.MultiTenant的多租户身份认证系统.zip
- (源码)基于Spring Boot和Vue3+ElementPlus的后台管理系统.zip
- (源码)基于C++和Qt框架的dearoot配置管理系统.zip
- (源码)基于 .NET 和 EasyHook 的虚拟文件系统.zip
- (源码)基于Python的金融文档智能分析系统.zip
- (源码)基于Java的医药管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功