Can ServiceStack support websockets? - xamarin.ios

Servicestack is awesome. I'm using it for my Xamarin projects (monotouch and monodroid).
Users login and authorised by ServiceStack. The session details are kept in memory i.e. userId, Ipaddress, etc.
But what would be the best way to add websocket functionality so I could push notifications to these users?
Or would it be better to just leave a regular websocket open on the client and have a small websocket server somehow read the session data (user Ipaddress) from ServiceStack in order to relay bespoke messages to client?

As an alternative to Web Sockets ServiceStack supports Server Sent Events for real-time event notifications. All the Chat Apps in the Live Demos utilizes Server Events for its real-time communication.
But it doesn't include any support for Web Sockets itself, although here's an example of using ServiceStack and SignalR in the same project.

Related

Using and securing rabbitmq mqtt websocket and use it in browser

We need some async workers for some 1-2 min tasks and then provide the user feedback from this tasks.
The idea would be to use the rabbitmq mqtt websocket plugin and provide the user feedback when the calculations done directly in the browser.
For our "old" stack we have some api endpoints as a layer between the user (browser) and rabbitmq services which more or less act as fire and forget.
As mentioned, we now need to provide feedback where we thought it would be create to user websockets (rabbitmq mqtt plugin).
But we are wondering how do we secure the exposed websocket endpoint for each user? Currently its not a problem as we have an amqps clients with X.509.
Our new features need has public access so we can not auth the user beforehand.
Is there a way to directly and securly use the exposed endpoint or do we need a layer in between as we have now?
The RabbitMQ Web MQTT plugin supports TLS. You can then use a username / password to authenticate the user, or use client certificates.
If you need public access then there is no way to secure the endpoint. This applies to all MQTT brokers, not just RabbitMQ.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
If you use a plugable authentication source (sorry, not familiar with what RabbitMQ offers here) e.g. that stores user/password in a database. Then you can generate a short lived set of credentials for each session and the webpage can request these from the server via a REST API and then use these to authenticate the MQTT connection over WebSockets.
This means that credentials are only exposed as variables for a short time as temporary variables in the browser, which can be revoked easily as soon as the web session/actions are complete

How to deal with apps that use a REST API but need a realtime chat (Socket.io)

I am planning to develop a mobile app which will retrieve data from a node.js REST API but also needs an integrated realtime chat with groups up to 12 people. How should I develop the backend in this case? Build everything with Websockets, including simple data communication or using both a REST API and Websockets?
I already developed an app with a REST API which later got a realtime chat with socket.io but using both feels wrong to me (especially when you use a PHP REST API and node.js for socket.io :D).
What would be the best practice in this case?

WebSocket or Periodic Requests in hybrid Apps?

I am developing an hybrid mobile app that collects some user info in background while the user is calling (just during a phone call). Then I have an admin dashboard on a website, where the admins can monitor the (almost) real-time status of the mobile users. To do this, my mobile app must send info to the server. Right now I just use:
setInterval(sendData, 5000) to send data each 5sec from the mobile app to the server.
setInterval(refreshData, 5000) to request the current status from the admin dashboard to the server.
I don't need a "strong real-time", so it's enough update each 5secs.
Anyway I'd like to know if it's better use web sockets among the mobile app and the server, since the app should send data very often during the day.
Thank you

firebase sending messages to multiple devices on web

I need to use firebase cloud messaging application in web application development. I am able to send the push notification to a single client from the server. But I dont know how to subscribe tokens, i.e, sending push notifications to multiple clients from a single server. Is there any example code available for sending messages/notifications to multiple clients?

What connection do Facebook and GMail use for messaging?

I'm building a web app that needs to be able to immediately receive messages from the server (kind of an instant message chat).
I noticed Facebook and GMail have messaging in a browser and do not require any browser plug-in for that.
What do they use?
I know websockets doesn't work when relying through a proxy?
Is there another good method?

Resources