Our server is used to Nginx as webserver and add compile module of nginx_push_stream. Before used to push stream had used to Restfull then changed to Websocket but websocket sometimes loss when the client or server had small bandwith. At 2019 year, from Websocekt to Server Sent Event (SSE) / event-source such as event stream or text/event-stream to reduce loss both of client or server.
Please anyone have any idea for library event stream is able to use to android client and iPhone client.
I have already used to Okhttp but there is not ready yet used event stream, RxSSE is not able to use in Android no respond at all.
I hope that next year OkHttp is already update OkHttp-EventSource for Android Client also iPhone Client
After 3 days, Struggling had search library for supporting SSE of Android client. Then, i found this blog Accessing SSE help me a lot to implementation SSE, also this the library SSE
This sample implementation SSE in kotlin version, even thought library is java version.
1. Preparing for event handler source
2. implementation event source
I hope this would be alternative method protocol from client to server than used RESTfull or Websocket. When server always sent data to client without need request from client as stream.
I have added a gist of using library SSE https://gist.github.com/subhanshuja/9079ec9df0927b1da26ee57cf9da1f26.