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

telegram中的MTProto代理不支持fake tls #17719

Open
1 task done
xiaolifeizei opened this issue Nov 26, 2024 · 8 comments
Open
1 task done

telegram中的MTProto代理不支持fake tls #17719

xiaolifeizei opened this issue Nov 26, 2024 · 8 comments
Labels
RSS bug Something isn't working

Comments

@xiaolifeizei
Copy link

路由地址

/telegram/channel/:username/:routeParams?

完整路由地址

/telegram/channel/zyfx_0315

相关文档

https://docs.rsshub.app/zh/routes/social-media#channel

预期是什么?

当设置了TELEGRAM_PROXY_HOST,TELEGRAM_PROXY_PORT,TELEGRAM_PROXY_SECRET后应该走MTProto协议正常获取内容
``

实际发生了什么?

TELEGRAM_PROXY_SECRET该参数只支持16 byte的密钥,而不支持更长的以ee开头的fake tls的密钥。

麻烦大佬处理一下,不然自建无法挂梯子

源码:/lib/routes/telegram/tglib/client.ts 21行

client = new TelegramClient(stringSession, apiId, apiHash, {
        connectionRetries: Infinity,
        autoReconnect: true,
        retryDelay: 3000,
        maxConcurrentDownloads: Number(config.telegram.maxConcurrentDownloads ?? 10),
        proxy:
            config.telegram.proxy?.host && config.telegram.proxy.port && config.telegram.proxy.secret
                ? {
                      ip: config.telegram.proxy.host,
                      port: Number(config.telegram.proxy.port),
                      MTProxy: true,
                      secret: config.telegram.proxy.secret,
                  }
                : undefined,
    });

部署

自建

部署相关信息

No response

额外信息

FetchError: FetchError: [GET] "https://t.me/s/zyfx_0315": <no response> fetch failed
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async $fetchRaw2 (D:\my\dev\workspace_nodejs\RSSHub\node_modules\.pnpm\o[email protected]\node_modules\ofetch\dist\shared\ofetch.d8adb063.cjs:276:14)
at async $fetchRaw2 (D:\my\dev\workspace_nodejs\RSSHub\node_modules\.pnpm\o[email protected]\node_modules\ofetch\dist\shared\ofetch.d8adb063.cjs:276:14)
at async $fetch2 (D:\my\dev\workspace_nodejs\RSSHub\node_modules\.pnpm\o[email protected]\node_modules\ofetch\dist\shared\ofetch.d8adb063.cjs:322:15)
at async <anonymous> (D:\my\dev\workspace_nodejs\RSSHub\lib\routes\telegram\channel.ts:194:24)
at async Object.tryGet (D:\my\dev\workspace_nodejs\RSSHub\lib\utils\cache\index.ts:92:27)
at async Object.handler (D:\my\dev\workspace_nodejs\RSSHub\lib\routes\telegram\channel.ts:191:18)
at async wrappedHandler (D:\my\dev\workspace_nodejs\RSSHub\lib\registry.ts:96:33)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\cache.ts:57:9)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\parameter.ts:65:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\anti-hotlink.ts:101:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\header.ts:26:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\template.tsx:15:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\debug.ts:16:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\access-control.ts:21:9)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\sentry.ts:18:5)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\trace.ts:17:9)
at async dispatch (file:///D:/my/dev/workspace_nodejs/RSSHub/node_modules/.pnpm/[email protected]/node_modules/hono/dist/compose.js:30:17)
at async middleware (D:\my\dev\workspace_nodejs\RSSHub\lib\middleware\logger.ts:36:5)

这不是重复的 issue

  • 我已经搜索了 现有 issue,以确保该错误尚未被报告。
@xiaolifeizei xiaolifeizei added the RSS bug Something isn't working label Nov 26, 2024
Copy link
Contributor

Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake.
如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

@pseudoyu
Copy link
Collaborator

It only accepts MT Proxy, not for other proxy protocols. The secret can be customised. (refer to https://github.com/Dofamin/MTProxy-Docker).

The whole process could refer to this article: https://www.pseudoyu.com/zh/2024/11/18/rsshub_telegram_channel_integration/

@xiaolifeizei
Copy link
Author

密匙填写:
第一种是无混淆的即客户端密匙原模原样填写,无需变化。
第二种是有随机填充的,客户端需要在原始的密匙开头加上,如:dd+secret
第三种就是fake tls混淆,客户端需要再原始的密匙开头加上ee,还需要在密匙后面拼接域名的十六进制形式,如:ee+secret+domain_in_hex

这里好像只支持第一种,第三种是不支持的,配置了以后连接不上

@xiaolifeizei
Copy link
Author

It only accepts MT Proxy, not for other proxy protocols. The secret can be customised. (refer to https://github.com/Dofamin/MTProxy-Docker).

The whole process could refer to this article: https://www.pseudoyu.com/zh/2024/11/18/rsshub_telegram_channel_integration/

I am using MTProxy but it does not support fake tls encryption,it start with "ee"

@pseudoyu
Copy link
Collaborator

okay! I'm working on it to support more types of secret keys.

@pseudoyu
Copy link
Collaborator

pseudoyu commented Nov 29, 2024

I found it's currently not supported by the official client library we used here, https://github.com/gram-js/gramjs

same issue here: gram-js/gramjs#426

I'm still investigating alternative solutions.

@xiaolifeizei
Copy link
Author

我发现我们使用的官方客户端库目前不支持它,https ://github.com/gram-js/gramjs

同样的问题在这里:gram-js/gramjs#426

我仍在研究替代解决方案。

Thanks for your hard work

@xiaolifeizei
Copy link
Author

I found it's currently not supported by the official client library we used here, https://github.com/gram-js/gramjs

same issue here: gram-js/gramjs#426

I'm still investigating alternative solutions.

I am using docker, is it possible to allow configuration of a global proxy in docker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants