centrifugal / centrifuge-dart

Dart (Flutter) client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket
https://pub.dartlang.org/packages/centrifuge
MIT License
109 stars 34 forks source link

Web support #53

Closed r-oman-G closed 1 year ago

r-oman-G commented 3 years ago

Create IWebSocket interface with similar methods in dart:html and dart:io WebSocket. This is have not a big difference between. Test's work normally. Trade-offs noticed: dart:html WebSocket should not use 'protocols' because in this case server will not response. And dart:html WebSocket should use binaryType = 'arraybuffer';

FZambia commented 3 years ago

@r-oman-G thanks, looks very promising! Could you please add a detailed pr description to describe things you done and maybe any trade-offs you noticed?

r-oman-G commented 3 years ago

@FZambia hi, thanks for fast answer. Update pull request

FZambia commented 3 years ago

Trade-offs noticed: dart:html WebSocket should not use 'protocols' because in this case server will not response.

Did you find the underlying reason of this? Would be nice to use centrifuge-protobuf subprotocol to avoid using ?format=protobuf in URL.

Also, plz run dartfmt -w lib/ test/ as CI currently fails.

r-oman-G commented 3 years ago

Did you find the underlying reason of this? Would be nice to use centrifuge-protobuf subprotocol to avoid using ?format=protobuf in URL.

yes, if we do it when we create webSocket then server will not response. Or response something like this "server can't response, try again". I'm try it many times, but anywey dart:html WebSockets can't read our request, if we use protocol during creation WebSockets

Also, plz run dartfmt -w lib/ test/ as CI currently fails.

Okay, I we'll do it tomorrow

FZambia commented 3 years ago

"server can't response, try again". I'm try it many times, but anywey dart:html WebSockets can't read our request, if we use protocol during creation WebSockets

On the server side you are using Centrifugo v2 right? Subprotocol only handled by Centrifugo v3 - maybe thats the reason.

r-oman-G commented 3 years ago

"server can't response, try again". I'm try it many times, but anywey dart:html WebSockets can't read our request, if we use protocol during creation WebSockets

On the server side you are using Centrifugo v2 right? Subprotocol only handled by Centrifugo v3 - maybe thats the reason.

maybe you right, cause i'm test centrifugo only with one server. By the way we use centrifugo v2

FZambia commented 3 years ago

Also, plz run dartfmt -w lib/ test/ as CI currently fails.

Still actual. @r-oman-G are you still interested in getting this merged?

r-oman-G commented 3 years ago

yts i will. Sorry for that, I have no time. I will try try it in next week

вс, 19 сент. 2021 г. в 11:45, Alexander Emelin @.***>:

Also, plz run dartfmt -w lib/ test/ as CI currently fails.

Still actual. @r-oman-G https://github.com/r-oman-G are you still interested in getting this merged?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/centrifugal/centrifuge-dart/pull/53#issuecomment-922438080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJI4TE26J6JJRHC6M4JIXZTUCWPIZANCNFSM5DJII4QA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

FZambia commented 3 years ago

Thx, no rush - just wanted to understand the status.

FZambia commented 2 years ago

There was a problem in CI which resulted in error, need to merge master – and tests should pass.

adimshev commented 2 years ago

Any updates?

FZambia commented 2 years ago

This is still awesome to have, but needs to be addressed over latest version of SDK. So whether this PR should be updated or a new one created.

FZambia commented 1 year ago

Closing in favour of #73