Comments (15)
Node 底层实现改了,下个版本修复
from whistle.
导出抓包看下
from whistle.
From: [email protected]
Node: v18.18.0
Host: MacBook.local
Date: 12/1/2023, 3:57:18 PM
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:405:5)
at Url.parse (node:url:442:17)
at urlParse (node:url:167:13)
at module.exports [as parseUrl] (/Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/util/parse-url.js:9:12)
at /Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/inspectors/rules.js:41:26
at /Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/plugins/index.js:1322:5
at getRulesMgr (/Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/plugins/index.js:1314:12)
at pluginMgr.getRules (/Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/plugins/index.js:1464:3)
at /Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/inspectors/rules.js:33:15
at /Users/xxx/.nvm/versions/node/v18.18.0/lib/node_modules/whistle/lib/rules/index.js:493:5
我遇到类似502的问题,上面👆是错误的 response,我的 node 版本是 18.18.0
,我降级到 14.17.0
也是正常的。
我是使用 Mock 数据才会出现这样的问题
Rules
xxx.com file://{products.json}
Values
products.json
502报错数据
[
{
"test": "#"
}
]
200正常数据
[
{
"test": ""
}
]
{
"test": "#"
}
看情况和 #
号有关系
from whistle.
重新安装最新版本试试
from whistle.
升级到2.9.62还是不行,nodejs版本:18.19.0
from whistle.
看下 Online 允许的是不是最新版本,把抓包导出我看下
from whistle.
看下 Online 允许的是不是最新版本,把抓包导出我看下
[
{
"useH2": false,
"startTime": 1704860097813,
"id": "1704860097811-020",
"url": "xxx",
"req": {
"method": "GET",
"httpVersion": "1.1",
"ip": "127.0.0.1",
"port": "58908",
"rawHeaderNames": {
"connection": "Connection",
"proxy-authorization": "Proxy-Authorization"
},
"headers": {
"host": "localhost:9001",
"sec-ch-ua": ""Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": ""macOS"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "navigate",
"sec-fetch-dest": "iframe",
"referer": "xxxx",
"accept-encoding": "gzip",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
"cookie": "xxx",
"connection": "close"
},
"size": 0,
"body": false,
"rawHeaders": {
"host": "localhost:9001",
"sec-ch-ua": ""Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": ""macOS"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "navigate",
"sec-fetch-dest": "iframe",
"referer": "xxx",
"accept-encoding": "gzip",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
"cookie": "xxx",
"Connection": "close"
}
},
"res": {
"ip": "::1",
"port": "9001",
"rawHeaderNames": {},
"statusCode": 502,
"headers": {
"content-type": "text/html; charset=utf8",
"x-server": "whistle"
},
"size": 286,
"body": "",
"base64": "PHByZT4KRnJvbTogd2hpc3RsZUAyLjkuNjINCk5vZGU6IHYxOC4xOS4wDQpIb3N0OiBCLTBHR0o3VExXLTAxNDQubG9jYWwNCkRhdGU6IDIwMjQvMS8xMCAxMjoxNDo1Nw0KRXJyb3I6IGNvbm5lY3QgRUNPTk5SRUZVU0VEIDo6MTo5MDAxCiAgICBhdCBUQ1BDb25uZWN0V3JhcC5hZnRlckNvbm5lY3QgW2FzIG9uY29tcGxldGVdIChub2RlOm5ldDoxNTU1OjE2KQoKCjxhIGhyZWY9ImphdmFzY3JpcHQ6OyIgb25jbGljaz0ibG9jYXRpb24ucmVsb2FkKCkiPlJlbG9hZCB0aGlzIHBhZ2U8L2E+CjwvcHJlPg==",
"rawHeaders": {
"content-type": "text/html; charset=utf8",
"x-server": "whistle"
}
},
"rules": {
"rule": {
"url": "xxx",
"files": null,
"not": false,
"name": "rule",
"root": null,
"isRegExp": true,
"protocol": null,
"pattern": {},
"matcher": "xxx",
"raw": "xxxx",
"isDomain": false,
"rawPattern": "xxx",
"lineProps": {},
"isTpl": false
}
},
"rulesHeaders": {},
"version": "2.9.62",
"nodeVersion": "18.19.0",
"dnsTime": 1704860097813,
"realUrl": "xxx",
"httpsTime": 1704860097823,
"useHttp": true,
"requestTime": 1704860097825,
"responseTime": 1704860097826,
"endTime": 1704860097827,
"method": "GET",
"hostIp": "::1",
"clientIp": "127.0.0.1",
"date": "2024/1/10 12:14:57.813",
"clientPort": "58908",
"serverPort": "9001",
"contentEncoding": "",
"body": "0 + 286",
"result": 502,
"type": "text/html",
"time": "14ms",
"download": "1ms",
"response": "1ms",
"request": "12ms",
"dns": "0ms",
"protocol": "HTTPS > HTTP",
"hostname": "xxxx",
"path": "xxx",
"order": 2,
"hide": false,
"lost": true,
"selected": true,
"active": true
}
]
from whistle.
没匹配到规则,自己先看下
from whistle.
没匹配到规则,自己先看下
这个代理抓包删除了部分内容,因为里面的规则涉及隐私,我重新配了一份不涉及隐私的
目前看起来就是因为protocol有个https->http,而本地服务是不支持http的,只支持https
[
{
"useH2": false,
"startTime": 1704874264787,
"id": "1704874264786-182",
"url": "https://www.test.com/index.html",
"req": {
"method": "GET",
"httpVersion": "1.1",
"ip": "127.0.0.1",
"port": "64523",
"rawHeaderNames": {
"connection": "Connection",
"proxy-authorization": "Proxy-Authorization"
},
"headers": {
"host": "localhost:9001",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": ""Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": ""macOS"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
"connection": "close"
},
"size": 0,
"body": false,
"rawHeaders": {
"host": "localhost:9001",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": ""Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": ""macOS"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
"Connection": "close"
}
},
"res": {
"ip": "::1",
"port": "9001",
"rawHeaderNames": {},
"statusCode": 502,
"headers": {
"content-type": "text/html; charset=utf8",
"x-server": "whistle"
},
"size": 286,
"body": "",
"base64": "PHByZT4KRnJvbTogd2hpc3RsZUAyLjkuNjINCk5vZGU6IHYxOC4xOS4wDQpIb3N0OiBCLTBHR0o3VExXLTAxNDQubG9jYWwNCkRhdGU6IDIwMjQvMS8xMCAxNjoxMTowNA0KRXJyb3I6IGNvbm5lY3QgRUNPTk5SRUZVU0VEIDo6MTo5MDAxCiAgICBhdCBUQ1BDb25uZWN0V3JhcC5hZnRlckNvbm5lY3QgW2FzIG9uY29tcGxldGVdIChub2RlOm5ldDoxNTU1OjE2KQoKCjxhIGhyZWY9ImphdmFzY3JpcHQ6OyIgb25jbGljaz0ibG9jYXRpb24ucmVsb2FkKCkiPlJlbG9hZCB0aGlzIHBhZ2U8L2E+CjwvcHJlPg==",
"rawHeaders": {
"content-type": "text/html; charset=utf8",
"x-server": "whistle"
}
},
"rules": {
"rule": {
"files": null,
"url": "https://localhost:9001/static-flex-table-app/index.html",
"not": false,
"name": "rule",
"root": null,
"isRegExp": false,
"protocol": null,
"pattern": "www.test.com/index.html",
"matcher": "https://localhost:9001/static-flex-table-app/index.html",
"raw": "www.test.com/index.html https://localhost:9001/static-flex-table-app/index.html",
"isDomain": false,
"rawPattern": "www.test.com/index.html",
"lineProps": {},
"isTpl": false
}
},
"rulesHeaders": {},
"version": "2.9.62",
"nodeVersion": "18.19.0",
"dnsTime": 1704874264787,
"realUrl": "https://localhost:9001/static-flex-table-app/index.html",
"httpsTime": 1704874264801,
"useHttp": true,
"requestTime": 1704874264803,
"responseTime": 1704874264805,
"endTime": 1704874264807,
"method": "GET",
"hostIp": "::1",
"clientIp": "127.0.0.1",
"date": "2024/1/10 16:11:04.787",
"clientPort": "64523",
"serverPort": "9001",
"contentEncoding": "",
"body": "0 + 286",
"result": 502,
"type": "text/html",
"time": "20ms",
"download": "2ms",
"response": "2ms",
"request": "16ms",
"dns": "0ms",
"protocol": "HTTPS > HTTP",
"hostname": "www.test.com",
"path": "/index.html",
"order": 1,
"hide": false,
"lost": true,
"selected": true,
"active": true
}
]
from whistle.
本地服务没起来
from whistle.
本地服务没起来
本地服务非常确认已经起来了哈,但是本地服务只支持https,直接通过https://localhost:9001/static-flex-table-app/index.html访问是可以的
目前看起来像是因为protocol有个https->http,而本地服务是不支持http的,只支持https
from whistle.
把 localhost
改成 127.0.0.1
试试
from whistle.
把
localhost
改成127.0.0.1
试试
可以了~请问这个是什么原因啊
from whistle.
localhost
指向的是 ::1
,你们服务没有监听这个网卡的端口
from whistle.
localhost
指向的是::1
,你们服务没有监听这个网卡的端口
node 16.2是可以的,单纯把node切换到16.2就好了
from whistle.
Related Issues (20)
- 支持 Microsoft store 安装软件
- 【工具】Firefox快捷切换whistle规则插件
- 开启代理后访问任何地址都提示连接超时 HOT 7
- SSL routines :unsafe legacy renegotiation disabled HOT 7
- 访问任意端口打开的都是whistle,直接访问不走代理是正常的 HOT 5
- 插入一段 script 标签是否支持给标签添加 type 属性? HOT 5
- 编码相异文件被同向处理导致乱码 HOT 1
- 希望Inspector 里的Headers中cookie增加一键复制功能 HOT 1
- 添加了https证书后,仍存在部分内容的为tunnel to的情况 HOT 4
- 模式匹配是否可以支持根据源ip来进行匹配而非通过目的域名或ip HOT 1
- 规则求教: 正则匹配之后的自动路径拼接 HOT 3
- 代理的接口有部分接口是404状态返回,确认接口没拼错 HOT 10
- 规则求教:匹配版本号 HOT 1
- 【求助】android代理whistle,会出现图片、视频上传失败的情况,只要把代理关了就可以上传成功了 HOT 5
- 华为鸿蒙可以安装whistle证书吗 HOT 1
- 有支持br压缩的计划吗 HOT 1
- whistle设置了代理之后手机说无法连接到互联网 HOT 6
- 2.9.70 版本rule(规则)优先级发生变化,在之前版本配置的规则失效 HOT 2
- whistle抓不到支付宝小程序的包
- 使用代理大量请求时Chrome浏览器请求会报错:net::ERR_HTTP2_PROTOCOL_ERROR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whistle.