Coder Social home page Coder Social logo

Comments (15)

avwo avatar avwo commented on May 17, 2024 3

Node 底层实现改了,下个版本修复

from whistle.

avwo avatar avwo commented on May 17, 2024

导出抓包看下

from whistle.

jing2si avatar jing2si commented on May 17, 2024
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.

avwo avatar avwo commented on May 17, 2024

重新安装最新版本试试

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

升级到2.9.62还是不行,nodejs版本:18.19.0

from whistle.

avwo avatar avwo commented on May 17, 2024

看下 Online 允许的是不是最新版本,把抓包导出我看下

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

看下 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.

avwo avatar avwo commented on May 17, 2024

没匹配到规则,自己先看下

image

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

没匹配到规则,自己先看下

image

这个代理抓包删除了部分内容,因为里面的规则涉及隐私,我重新配了一份不涉及隐私的
目前看起来就是因为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.

avwo avatar avwo commented on May 17, 2024

本地服务没起来

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

本地服务没起来

本地服务非常确认已经起来了哈,但是本地服务只支持https,直接通过https://localhost:9001/static-flex-table-app/index.html访问是可以的
image

目前看起来像是因为protocol有个https->http,而本地服务是不支持http的,只支持https

from whistle.

avwo avatar avwo commented on May 17, 2024

localhost 改成 127.0.0.1 试试

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

localhost 改成 127.0.0.1 试试

可以了~请问这个是什么原因啊

from whistle.

avwo avatar avwo commented on May 17, 2024

localhost 指向的是 ::1,你们服务没有监听这个网卡的端口

from whistle.

jayjliang avatar jayjliang commented on May 17, 2024

localhost 指向的是 ::1,你们服务没有监听这个网卡的端口

node 16.2是可以的,单纯把node切换到16.2就好了

from whistle.

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.