Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve logic of strict mode #83

Closed
wants to merge 1 commit into from
Closed

fix: improve logic of strict mode #83

wants to merge 1 commit into from

Conversation

palfans
Copy link

@palfans palfans commented May 7, 2019

There was a typo of server.blacklist, and the logic of strict mode doesn't work when I connect via Quantumult. Now it is working with all my devices.

Fixes #72

server.js Show resolved Hide resolved
@nondanee
Copy link
Owner

nondanee commented May 7, 2019

可能会 revert 掉很大一部分,感觉有点不尊重你 😂
所以还是我跟你说,你来改吧,辛苦了(如果你觉得没关系的话,我改也行 😀)

localhost 或许应该一直在黑名单了 (怕从代理反射探到内网的端口)

其实从 connect tunnel 分离出来的本地流量有个特殊标记 ctx.req.local

这个标记在判断使用 upstream proxy 的条件里用过

if(global.proxy && !req.local){

可以直接用这个标记跳过 filter,改这行

if(!ctx.decision){

关于 whitelist blacklist 的问题我再看看吧,或许二选一启用比较好一点?
多谢

@palfans
Copy link
Author

palfans commented May 7, 2019

哈哈,让你见笑了。我对 Node.js 的认识仅限于听说过…… 😂
昨天总是搞不定,只好硬着头皮在代码里通过加 console.log() 的方法来定位请求在哪里被拒绝了,然后发现了 localhost 的问题,所以对整个结构完全没有深入的认识。你如果能改,应该最好,以免我又引入了其他的误解,毕竟连二把刀都算不上。
另外,如果按照#65 配置了转发音源的话,在打开严格模式的情况下,这个域名也会因为不是白名单而被拒绝,造成歌曲列表能亮,但是转发失败,导致不能播放。你看,是否需要自动判断在白名单中加入这个转发域名?

@nondanee
Copy link
Owner

nondanee commented May 7, 2019

@palfans
那我来改?
因为我自己只在本地运行的,所以一直不知道 strict 模式有问题 😂
(加 strict 是因为之前自己搭了个被别人用来爬爱奇艺优酷了很气)

@palfans
Copy link
Author

palfans commented May 7, 2019

@nondanee 好的!:smile:
那我就关掉这个PR了。
多谢!

@palfans palfans closed this May 7, 2019
nondanee added a commit that referenced this pull request May 7, 2019
lizeyan pushed a commit to lizeyan/UnblockNeteaseMusic that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quantumult 应该如何配置呢?
2 participants