Giter Club home page Giter Club logo

Comments (16)

vibbow avatar vibbow commented on July 19, 2024

附加说明:
在 clash 提供的 http代理下,以上代码会等待60秒,然后收到返回的结果。

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

附加说明:
在 clash 提供的 http代理下,以上代码会等待60秒,然后收到返回的结果。

每次都是60s吗?

from clash.

vibbow avatar vibbow commented on July 19, 2024

附加说明:
在 clash 提供的 http代理下,以上代码会等待60秒,然后收到返回的结果。

每次都是60s吗?

对的,每次都是60秒,然后收到响应结果。

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

附加说明:
在 clash 提供的 http代理下,以上代码会等待60秒,然后收到返回的结果。

每次都是60s吗?

对的,每次都是60秒,然后收到响应结果。

不会php,我看下curl能构造出来不

from clash.

vibbow avatar vibbow commented on July 19, 2024

附加说明:
在 clash 提供的 http代理下,以上代码会等待60秒,然后收到返回的结果。

每次都是60s吗?

对的,每次都是60秒,然后收到响应结果。

不会php,我看下curl能构造出来不

我测试过curl,是没问题的。

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

对应的头部都加上了?

from clash.

vibbow avatar vibbow commented on July 19, 2024

对应的头部都加上了?

从 burp suite 的抓包来看,是identical的。

from clash.

vibbow avatar vibbow commented on July 19, 2024

我开始以为是漏了什么header,导致clash无法正常解析。
但是用curl模拟了一个一模一样头的请求,发过去就是正常的。

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

抓包看是,php一直没有断开,最后应该是60tcp发了fin包断开

from clash.

vibbow avatar vibbow commented on July 19, 2024

我大概知道原因了。

PHP在请求的时候发送了 Connection: close Header
但是 Clash 在返回的时候依然返回了 Connection: Keep-Alive

from clash.

vibbow avatar vibbow commented on July 19, 2024

直接请求源站返回的header

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 07 Dec 2018 11:23:53 GMT
Content-Type: application/json
Content-Length: 1492
Last-Modified: Fri, 07 Dec 2018 11:23:39 GMT
Connection: close
Vary: Accept-Encoding
ETag: "5c0a583b-2b2"

Clash返回的header

HTTP/1.1 200 OK
Content-Length: 1492
Connection: keep-alive
Content-Type: application/json
Date: Fri, 07 Dec 2018 11:28:02 GMT
Etag: "5c0a58ed-2b3"
Keep-Alive: timeout=4
Last-Modified: Fri, 07 Dec 2018 11:26:37 GMT
Proxy-Connection: keep-alive
Server: nginx
Vary: Accept-Encoding

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

应该是多加的几个头部引起的问题

from clash.

vibbow avatar vibbow commented on July 19, 2024

应该是多加的几个头部引起的问题

应该是因为Clash没有遵循客户端的要求关闭连接。
客户端要求了 Connection: close,数据传输完成后就应该关闭连接了。
但是Clash依然保持了连接,导致客户端继续在等待。

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

我大概知道原因了。

PHP在请求的时候发送了 Connection: close Header
但是 Clash 在返回的时候依然返回了 Connection: Keep-Alive

你说的对,我看下怎么修

from clash.

beyondkmp avatar beyondkmp commented on July 19, 2024

你可以先参考这个实现下 https://stackoverflow.com/questions/18187419/get-file-contents-when-connection-is-keep-alive, 自己先判断下content-length

from clash.

vibbow avatar vibbow commented on July 19, 2024

这个不是我写的代码,是Composer的代码......
我只是把其中受影响的核心部分提炼出来了...

from clash.

Related Issues (20)

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.