i have created an notification server, which is application specific, now am preparing an application independent server to send notification to the clients using that application for synchronizing purpose, am not asking code and all, will you give me suggestion on this.
What is the basic need for an development of application independent component?
The best thing to do is to create a message queue (pub-sub) that different applications can connect to easily.
If your app isn't that big you can create a TCP server and send information to everybody connected. If you need to scale your app you can use something like Redis, ZeroMQ, RabbitMQ etc.
You can checkout my Twitter Steam application to see how I achieve that:
app: https://github.com/alessioalex/Presentations/tree/master/WebUp4/applications
TCP Server implementation: https://github.com/alessioalex/Presentations/blob/master/WebUp4/applications/twitter-streaming/tweetBroadcaster.coffee
Related
I am trying to develop a flutter chat app using nodejs and socketio.i'm just getting started with the socketio i have surf several examples in which every front end or client side having a set of socketio script. Can i develop my code purely server side? so that i can integrate with any type of front end.
You can do that. Socket.io is a web socket implementation in node js. It enables real-time, bidirectional and event-based communication between client and server.
Server and client can send and receive the events. If you don't want write any script in client side then you don't have any use of sockets.
Edit:
socket.io given nice example for chat application with explanation. https://socket.io/get-started/chat/
Socket.io has two distinct parts - the server and the client. The docs make this clear. There is nothing preventing you from just writing the server part, and leaving the client implementation out of the equation, for someone else to implement.
Although the main point of Socket.io is to implement the WebSocket protocol, it does so by wrapping it in its own interface, so to speak. So a socket.io server can only talk to socket.io clients, not clients that implement WebSocket in other ways. That being said, there are socket.io client libraries for pretty much every major language out there:
Javascript (main client)
Java
C++
Dart/Flutter
You also asked about React and Angular, but both of those are web front-ends, so there should be no reason why they can't use the standard Javascript client library with those frameworks.
Background:
I am building a reactJS application using AWS cognito, dynamo and S3. The application is based in the recruitment sector where employers and employees can post and view jobs respectively. When an employee applies for a job the employer can view the employees profile and decided whether or not to message them. Employees and employers converse via an on-site messaging service.
The Question:
What is the best method to facilitate user chat?
i.e. what is a nice & efficient way to store messages and notify users when they have a new message.
Our current approach is to have a setTimeout() on the site and check for new messages but this will be very inefficient so i'm looking for some guidance.
I would like to stay inside the amazon infrastructure as much as possible but I am open to all suggestions.
I'm currently building something similar for a startup I'm working at. Our React app is served by node.js server, while the API backend is provided by a django API with drf. As in your user chat case, we need to handle some real time data arriving in the frontend.
Our approach
The solution may be split up into inter server and server-browser realtime communication:
We use redis (aws elasticache to be exact) as a publish/ subscribe message queue to push incoming data from the API backend to the nodejs server. Specifically, whenever an instance of the model in question is created due to an HTTP POST call (i.e. in your case a message, which is send to the server), we publish JSON serialized information on a channel specific to the actors of concern.
On the node.js servers, we subscribe to channels of interest and receive information from the backend in real-time. We then use socket.io to provide a websocket connection to the frontend, which may be easily integrated with React.
Limitations of this approach
You cannot simply server your React app as a static website from S3 and have to rely on a node x React approach. react-boilerplat(by Max Stoiber I think) is a great way to start.
What's more, you can also use websockets end to end. We use this approach as our data source isn't a browser but a constrained device.
Hope that helps!
One simple way to do this would be to have the client poll the server every 10 seconds or so, but I don't think that's the best way to go about it.
I don't want to broadcast notifications to all clients, but only to 1 client at a time.
The internet is loaded with articles on how to do this but I can't figure out which one is more appropriate for my problem.
https://github.com/websocket-rails/websocket-rails
https://github.com/ryanb/private_pub
Consider using a hosted pub/sub broker like Pusher or Realtime (the company I work for) and focus on developing your app and not managing the required real-time infrastructure.
From your Rails backend you would send the messages through the REST API and use the websocket-based JavaScript library to receive them on browser clients (subscribe).
For private messages simply subscribe each user to their own private channel (maybe using their user id).
i would like to know if it is possible to have socket.io featured client website to send message to winsock c++ server application?
My current project involve controlling a robot using c++ application and i have design a simple local host website.
i would like to have a web page as user interface (client) and my c++ application (server) that will accept connection from client and listen to the port for incoming messages. ( which mean socket.io interacting with winsock through IP)
I have a working C++ winsock client/server application that are able to communicate between each other using winsock. Besides that, i have play around with the socket.io demo chat from this webpage http://socket.io/get-started/chat/
If so, is there any good tutorial or guideline out there that capable of having the sockets interaction? i have no luck finding one.
Thanks
I'm looking to have a video conference website running on node.js + express.js instead of regular apache and I'm having trouble deciding on a solution.
I need the server to send the website to the user through express.js, plus, connect people in a queue so they can enter a video conference with strangers.
Should I build two different server applications, one for the express.js and one for the webRTC server, listening on different ports?
If so, how can I make the user interact with the different aplications? They will need to be able to login, be placed in the queue and be able to see the strangers once the connection is established.
WebRTC and Express.js is differ ExpressJS (Web frame work mapping your request)
but WebRTC is differ(Peer-to-Peer) communication with the help of signalling means exchange information about two browser so you can use Socket.IO or any other websocket framework
Every thing depend of signalling you want to connect particular person send signalling that particular person its not possible in Express.js so use any websocket framework like socket.io