Hey all,
Need a little advice on using Socket.io with Meteor.
I have an existing Node.js project that has two components.
- (Client) HTML page which has a simple upload form and establishes a Socket.io connection to the Node.js API
- (Server) Node.js API which receives uploaded images/videos and broadcasts over Socket.io whether the upload and/or processing has been successful, with a accompanying link to the processed files upon completion. (This will sit on a separate server.)
I’d like to bring the client portion of the existing project into Meteor and have it sit behind a user login, as well as have Meteor handle success/failure depending on a Socket.io broadcast.
Basically:
- Client uploads images/video via upload form
- Server receives images/video and processes them
- Server broadcasts via Socket.io success or failure
- (On success) Client receives broadcast via Socket.io and creates a new document in a collection, as well as notifies user of success.
- (On failure) Client receives broadcase via Socket.io notifies user of failure and asks user to re-upload files.
So the question is, what’s the correct way of implementing Socket.io and the client in Meteor?