连接 curl 脚本输出“* 来自服务器的空回复”,但是 Fiddler 可以获取数据

connect with curl script output "* Empty reply from server", but Fiddler to get data is ok

当我使用 fiddler 4 时可以捕获以下 link:

URL

与以下 RAW header :

GET http://'URL' HTTP/1.1
Host: 'URL'
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: */*
Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: 'URL'
Connection: keep-alive
Cookie: win007BfCookie=null; bfWin007FirstMatchTime=2019,7,13,08,00,00; UM_distinctid=16c8b3edbf14fc-062d46919e565-14367b40-190140-16c8b3edbf22e7; win0168BfFavoriteCookie=1

提琴手 4 的输出

sData[1743630]=[[0.98,0,0.86,0.82,0.25,1.04,,,],[2.55,3.20,2.40,2.07,3.35,3.15,,,],[0.88,2.25,0.94,1.03,2.5,0.81,,,],[0.90,0,0.94,1.23,0.25,0.67,,,],[1.06,1.00,0.76,1.04,1,0.80,,,],[3.15,2.03,3.20,2.69,2.08,3.70,,,]];

但是当我使用 curl 执行以下脚本时:

curl -vvv 'URL' -H 'Referer: 'URL'

curl 的输出(windows cmd shell):

curl -vvv 'URL' -H 'Referer: 'URL'
* Could not resolve host: 'http
curl: (6) Could not resolve host: 'http
*   Trying 47.75.149.10:80...
* TCP_NODELAY set
* Connected to 'URL' (47.75.149.10) port 80 (#1)
> GET /' HTTP/1.1
> Host: 'URL'
> User-Agent: curl/7.65.3
> Accept: */* 
>
* Recv failure: Connection was reset
* Closing connection 1
curl: (56) Recv failure: Connection was reset

curl 的输出 (linux shell):

root@xxxxx:~# curl -vvv 'URL' -H 'Referer: 'URL'
*   Trying 47.52.91.249...
* TCP_NODELAY set
* Connected to www.win0168.com (47.52.91.249) port 80 (#0)
> GET 'URL' HTTP/1.1
> Host: 'URL'
> User-Agent: curl/7.58.0
> Accept: */*
> Referer: 'URL'
>
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

win0168.com 阻止卷曲。该块是通过 User-Agent header 检测实​​现的。使用 wget,或设置不包含短语 "curl" 的假用户代理。作为记录,您的 curl 的 User-Agent 是

User-Agent: curl/7.65.3

但是如果您将 UA 的 curl 名称倒过来,您将得到响应,

curl -A 'lruc' -H 'Referer: http://www.win0168.com/' 'http://www.win0168.com/vbsxml/goalBf3.xml?r=0071565705912000'

lruccurl 写反了。)