satorijs / satori

The Universal Messenger Protocol
MIT License
159 stars 47 forks source link

Bug: proxyAgent does not handle http proxy correctly #39

Open MirrorCY opened 2 years ago

MirrorCY commented 2 years ago

Describe the bug

Parametric proxyAgent does not work well with http proxies. It appears that the proxy agent transforms the endpoint port to the proxy protocol default port. But here's the weird thing, it works good with socks5 proxy.​ (it doesn't convert port to 1080) For example: proxyAgent: http://192.168.1.1:7890 endpoint url: https://api.telegram.org (:443) actually visited endpoint url: https://api.telegram.org:80

在适配器插件中配置 http 代理似乎会把访问的端口转换为代理协议的默认端口,比如使用 http://192.168.1.1:7980 作为代理时访问 https://api.telegram.org 会在代理的日志中发现,实际访问的地址为 https://api.telegram.org:80 但是使用 socks://192.168.1.1:7890 就不会出现这个问题,遇到这个问题的小伙伴可以先这样用顶一顶。

Steps to reproduce

Install and configure Fndroid/clash_for_windows_pkg 0.20.6 open Allow LAN configure proxyAgent an http proxy in @koishijs/plugin-adapter-telegram, e.g. http://192.168.1.1:7890 start adapter and see connection in clash

Expected behavior

follow endpoint port when using proxy

Screenshots

WQ`2GMR {V2FTXAQ41 G260

Versions

MirrorCY commented 2 years ago

https://github.com/koishijs/koishi/issues/835

DoiiarX commented 5 months ago

到现在都没有修复吗?

shigma commented 5 months ago

到现在都没有修复吗?

使用 socks://127.0.0.1:7890 即可。

shigma commented 1 month ago

@lengxii

您的评论中泄露了 bot token,我已经将其删除。考虑到安全问题,请尽快更换你的 bot token。

如果您无法访问某个地址,可以尝试设置代理或者使用抓包工具进行测试,这大概率并非 koishi 或者 satori 方面的问题。