Coder Social home page Coder Social logo

完全用不了了 about php-proxy HOT 17 OPEN

362227 avatar 362227 commented on June 3, 2024
完全用不了了

from php-proxy.

Comments (17)

koalabearguo avatar koalabearguo commented on June 3, 2024

报的什么错误?截个图看看

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

我刚试了我的,我的环境是win10+chrome使用正常

那个证书我中间更新过一次,之前是V1版本的,后面更新到了V3,你可以尝试把旧的证书删掉,把库上最新的证书再导入一遍应该就好了

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

可以了。

问下能不能支持跳转的php地址(php Fetch server)。比如我填的是https:/www.aaa.com/1.php,这个地址会跳转到https:/www.bbb.com/1.php,我实际就是要https:/www.bbb.com/****.php(每天会变化)

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

我设置了前置代理
"sni": "a.bc.com",
"listen": "127.0.0.1:8081",
"debug": false,
"insecure": false,
"autoproxy": true,
"user-agent": ""
"proxy": "http://127.0.0.1:1086"
}

报错
2022/06/09 10:20:12 proxy.go:297: Post "https://a.bc.com/php-proxy/index.php": dial tcp: lookup a.bc.com: no such host

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

我设置了前置代理 "sni": "a.bc.com", "listen": "127.0.0.1:8081", "debug": false, "insecure": false, "autoproxy": true, "user-agent": "" "proxy": "http://127.0.0.1:1086" }

报错 2022/06/09 10:20:12 proxy.go:297: Post "https://a.bc.com/php-proxy/index.php": dial tcp: lookup a.bc.com: no such host

你要控制一下这个跳转码,golang http库默认会跳转的,我查了资料,你需要控制你的状态码是307/308,这样POST方法才会跳转。

301 (Moved Permanently)
302 (Found)
303 (See Other)
307 (Temporary Redirect)
308 (Permanent Redirect)
If permitted, a 301, 302, or 303 redirect causes subsequent requests to use HTTP method GET (or HEAD if the original request was HEAD), with no body. A 307 or 308 redirect preserves the original HTTP method and body, provided that the Request.GetBody function is defined

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

我设置了前置代理 "sni": "a.bc.com", "listen": "127.0.0.1:8081", "debug": false, "insecure": false, "autoproxy": true, "user-agent": "" "proxy": "http://127.0.0.1:1086" }

报错 2022/06/09 10:20:12 proxy.go:297: Post "https://a.bc.com/php-proxy/index.php": dial tcp: lookup a.bc.com: no such host

你这个看起来代理没有设置成功,如果我没有看错,你这个后面少个逗号

"user-agent": ""

我自己测试并不会出现你的这个问题,后面我改下,如果启用了前置代理,启动的时候打印出来,要不然也不知道是否启用了前置代理

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

你要控制一下这个跳转码,golang http库默认会跳转的,我查了资料,你需要控制你的状态码是307/308,这样POST方法才会跳转。

301 (Moved Permanently)
302 (Found)
303 (See Other)
307 (Temporary Redirect)
308 (Permanent Redirect)
If permitted, a 301, 302, or 303 redirect causes subsequent requests to use HTTP method GET (or HEAD if the original request was HEAD), with no body. A 307 or 308 redirect preserves the original HTTP method and body, provided that the Request.GetBody function is defined

默认的反正没有作用,这要怎么修改

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

你方便的话,把你的fetchserver php地址和密码发给我,我debug看下。[email protected],这是我邮箱

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

你方便的话,把你的fetchserver php地址和密码发给我,我debug看下。[email protected],这是我邮箱

发了

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

应该要先对fetchserver php地址处理,如果php地址不会跳转,那就直接读取源地址;如果会跳转,那就抓一下跳转后的地址,再读取这个新地址。

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

是这样的,因为工具本身,访问fetchserver是用的POST方法,这种情况如果是302状态的话,实际会跳转到目的地址用GET方法去请求(body会被自动丢弃),因次得不到想要的数据。按照协议的要求如果是POST方法就要用307/308跳转,这样才能保持正确的数据转发。当然可以做一些这样不兼容协议的转换操作,不过这是另外一回事了。我们通常访问网页当然大部分都是GET,因此301,302都能跳转。其实这个工具已经自己跳转了,只不过POST变成GET了,BODY被丢弃了。也许有的网页跳转控制GET是302,但是POST就307,这是正常的。如果强行改掉也许会出现兼容问题,如果你确实需要我可以专门给你编辑修改个版本,我就不上库了。

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

https://go.koalabear.tk/windows_amd64.tar.gz

这是专门给你适配了代码,我试了下可以用,你可以试试

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

好了,可以了。

不过那个证书问题依旧没有完全解决。之前我删了旧证书,重新导入了新证书,可以用了,但大多数网站还是报错, remote error: tls: unknown certificate

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

不知道你导入的位置是“受信任的根证书颁发机构”这里吗,理论来讲浏览器应该会信任的,如果确实浏览器提示不可信任,那可能是导入的位置不对(或者其他原因浏览器么有加载这个证书)

具体你的log我不知道是什么样子的,浏览器正常不,如果浏览器正常,是不是你fetch server的ssl证书不受信任

remote error: tls: unknown certificate:这个log具体我不知道是指的浏览器这边,还是fetch server这边。

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

重新导入了下证书,客户端“remote error: tls: unknown certificate”提示没有了。
但问题还是一样,比如我浏览vimeo和heroku,heroku正常,vimeo不正常且浏览器显示的是empty response
image

用下载工具也是这样,heroku正常
image

vimeo不正常
image

from php-proxy.

koalabearguo avatar koalabearguo commented on June 3, 2024

你使能了智能代理,heroku走的是本机,不是走的远程的fetchserver。你看proxy.go 297这里后面返回的确实是EOF就是空的,看起来,你的电脑到fetchserver连接有问题,你那里指向的IP是不是被封锁了(还是干扰了),我用你的fetchserver访问vimeo首页是正常的。如果网络访问没问题,大概就是你的fetchserver感觉有什么限制

from php-proxy.

362227 avatar 362227 commented on June 3, 2024

不知道啊。我用旧版php-proxy和goproxy都正常,同样的php地址(跳转后的)

from php-proxy.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.