找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 59|回复: 6

有没有php大佬能给curl开发一个反向代理程序?

[复制链接]

19

主题

352

回帖

799

积分

高级会员

积分
799
发表于 2018-7-18 14:58:16 | 显示全部楼层 |阅读模式
exec wget
回复

使用道具 举报

459

主题

2900

回帖

7253

积分

论坛元老

积分
7253
发表于 2018-7-18 15:02:10 | 显示全部楼层
一群大佬正在赶赴战场,请拿出现金做好准备!!!
回复

使用道具 举报

19

主题

53

回帖

169

积分

注册会员

积分
169
发表于 2018-7-18 15:02:34 | 显示全部楼层
就是说根据提交的参数进行http请求并返回结果?
回复

使用道具 举报

19

主题

53

回帖

169

积分

注册会员

积分
169
发表于 2018-7-18 15:05:07 | 显示全部楼层
本帖最后由 dovihila 于 2018-7-18 15:17 编辑

suzizi 发表于 2018-7-18 15:09

和nginx反向代理的需求一样  只是nginx不支持http2反向代理

而我发现curl可以http2   所以就有这么个想 ...


似乎可以通过修改编译选项支持
https://www.zhihu.com/question/268666424

不过好像有性能问题
https://trac.nginx.org/nginx/ticket/923


又看了一下,应该是不行的。
回复

使用道具 举报

19

主题

53

回帖

169

积分

注册会员

积分
169
发表于 2018-7-18 15:09:10 | 显示全部楼层

suzizi 发表于 2018-7-18 15:09

和nginx反向代理的需求一样  只是nginx不支持http2反向代理

而我发现curl可以http2   所以就有这么个想 ...


找到个项目
https://github.com/NitorCreations/nitor-backend

java语言,简介是Async http2 reverse proxy

不知道是否能满足你的需求修改编译选项 在configure的选项中加入--with-http_v2_module,--with-http_ssl_module。
回复

使用道具 举报

0

主题

1

回帖

4

积分

新手上路

积分
4
发表于 2018-7-18 15:14:05 | 显示全部楼层

suzizi 发表于 2018-7-18 15:31

感觉知乎错了,没听说proxy_http_version 还有2这个选项。。。

等会试试去  但是感觉添加http2选项只是  ...

的确是错的,这个页面说了。
https://trac.nginx.org/nginx/ticket/923


    Resolution set to wontfix
    Status changed from new to closed

There are no plans to implement HTTP/2 support in the proxy module in the foreseeable future, see ​detailed answer here. If you want to use nginx to balance multiple servers, consider using ​the stream module to do this.
回复

使用道具 举报

19

主题

53

回帖

169

积分

注册会员

积分
169
发表于 2018-7-18 15:09:00 | 显示全部楼层

suzizi 发表于 2018-7-18 15:35

谢谢啊  我是看不懂 哈哈。
我还需要多IP多出口这个需求,只是curl有个选项 默认支持多IP多出口

可能可以在这个基础上修改完成,php用curl库反代

https://github.com/michaelfranzl/no.php
介绍:
The PHP script simply reads all requests from a browser pointed to it, forwards them (via PHP's curl library) to a web application listening at another URL (e.g. on a more powerful, more secure, more private, or more capable server in a different data center), and returns the responses transparently and unmodified.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2025-4-20 02:28 , Processed in 0.016914 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表