获取网络请求数据,获取并保存流量大小,感觉数据大小不对
- Dominant language
- JavaScript
- Stars
- 7.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
我是利用规则 rule.js保存的请求、返回结果数据大小
```
if (requestDetail.url.indexOf('https://*********') === 0) {
if (requestDetail.url.indexOf("https") === 0) {
url = requestDetail.url;
requestLength = requestDetail.requestData.length;
// requestLength = requestDetail.length;
console.info("requestLength:");
console.info(requestLength);
return null;
}
},
*beforeSendResponse(requestDetail, responseDetail) {
if (requestDetail.url.indexOf("https") === 0) {
responseLength = responseDetail.response.body.length;
console.info("responseLength:");
console.info(responseLength);
return null;
}
},
}
```
但是实际保存的数据大小和通过其他代理工具如charles抓到同一个网络请求数据大小不一致,不知道是不是anyproxy保存的数据大小信息没有包含header内容? 还是我取数据的方法不对?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the rule.js hooks shown in the issue, especially requestDetail.requestData.length and responseDetail.response.body.length. Compare those values with the same request captured by Charles and check whether these fields represent only body data or include headers. Done means documenting the correct measurement method or confirming the cause of the size discrepancy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100