0

Here is my problem... I have a node server that multiple node terminals(raspberry pi) connect to. These node terminals run a series of jobs and some of them generate files. The files are not saved in the terminal but in a mysql blob. Now these terminals are managed through an interface in the server (a CRM webpage). I manage them using socket.io and there is also redis available. Through socket.io I can tell the terminal what file I want, but the problem I'm facing is getting the file to the requesting browser client. I can identify the browser via the socket id but I am not sure as to how I am going to serve that file. Any help or suggestion would be great. Note: Im not using any JS or nodejs frameworks.

LouieV
  • 1,032
  • 2
  • 15
  • 28
  • 1
    How about just exposing them via a http server (since you're already running node) and making a simple GET requests from the clients? It seems like you can send them the URL to fetch using sockets, if I understood it correctly. – Tim Apr 21 '14 at 15:12
  • Are you suggesting running a server on the terminal for file fetching purposes? – LouieV Apr 21 '14 at 15:15
  • Either that, or telling your central node server that they need to pick up and expose a file. You could use redis pubsub for the notification. Then you could send the data between terminals and server via a socket, put it in a temporary directory, instruct the browsers to fetch and then remove the file again. Something like that. Since I don't know the exact setup and problems involved, it's hard to suggest a good architecture. – Tim Apr 21 '14 at 15:18

0 Answers0