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

[FEAT]: add support for WebSocket transports #78

Closed
aofei opened this issue Mar 8, 2021 · 8 comments
Closed

[FEAT]: add support for WebSocket transports #78

aofei opened this issue Mar 8, 2021 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@aofei
Copy link
Contributor

aofei commented Mar 8, 2021

Is your feature request related to a problem? Please describe.

I think if this project can support MTProto connection over WebSocket, it'll be able to solve the blocking problem of some ISPs.

Describe the solution you'd like

For API, maybe we can add a field like WSEndpoint (an HTTP URL string) to the mtproto.Config. If both ServerHost and WSEndpoint have values, WSEndpoint takes precedence.

Describe alternatives you've considered

N/A

Additional context

https://core.telegram.org/mtproto/transports#websocket

https://core.telegram.org/mtproto/mtproto-transports#transport-obfuscation

@aofei aofei added the enhancement New feature or request label Mar 8, 2021
@aofei
Copy link
Contributor Author

aofei commented Mar 8, 2021

This one can be assigned to me, I'll try to implement it. But I haven't dug the transport layer code of this project yet. I'm not sure if there will be any difficulties. So it may take some time.

@quenbyako
Copy link
Member

@aofei yeah, it's great idea, connect to telegram via websockets can improve stability of connection (i hope at least). I'll try to implement uris firstly (one way or another, this stuff must be placed in this package) and make test stand for protocol

👍 👍 👍 👍

@quenbyako
Copy link
Member

@aofei i've created separate package for transport stuff (like transport modes, transport platforms etc), try to push this changes today, but i made only tcp platform, we need to create somehow websocket platform as well.

@aofei
Copy link
Contributor Author

aofei commented Mar 22, 2021

@quenbyako

Sorry, I couldn't find the "transport" package you mentioned. Hasn't it been made public yet?

@quenbyako
Copy link
Member

@aofei yeah, still working and testing. Unfortunately, i got a lot of work on these days 😩

@quenbyako
Copy link
Member

@aofei added experimental transport directly to main branch (cuz why not), see latest commits

It's required to cover multiple tests, cause, you know, poor tests better than no tests 🙃

Currently it's not integrated in main mtproto struct because i'm not sure that it doesn't break anything, but i alreday tested new transports, and they seems working well. But, again, i'm not sure and we need to test them.

@quenbyako
Copy link
Member

new transport package now is using in the main mtproto structure since this commit 🎉🎉🎉🎉

I'll still working on websockets implementation (@aofei your help still can be very helpful), but actualy i hope that this new package already has pretty stable and flexible api.

Also, looks like we fixed #49 issue, now, even with high load of requests id didn't see any panic by bad seqno 🤔 but needs more tests

@quenbyako
Copy link
Member

Unfortunately, i must close this feature request, cause websockets transport is overcomplicated and obfuscated as well as documentation is. I was experimenting with connection through websockets since april, and still no any positive movement. Mtproto architecture is too sucks.

When we will get official telegram developers support, i promise we will come back to this feature, for me it looks pretty tasty and useful too as for you. But currently it's too hard to implement.

@quenbyako quenbyako added the help wanted Extra attention is needed label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants