title: POST to controller action in node and trigger websocket connection to client
body: <p>New to node and websockets, I'm trying something to create something unlike the typical game or chat app. </p>
  
  <p>I need to be able to post some variables to an action, perform some lookups and then connect to the client with the found vars. I genuinely don't know if this is possible.</p>
  
  <p>The major problem I'm having is that I <em>don't have a typical js client</em>, no browser, nada. My only clients are python websocket clients. I have these connecting to the server OK... Well, they can ping a the server - I'm trying with Socket.io, Faye and Worlize. I'd prefer to use socket.io.</p>
  
  <p>For example, if I post this:</p>
  
  <pre><code> curl -X POST 'http://localhost:8080/timeout?id=1238763876&amp;time=27365716576&amp;bla=stuff' 
  </code></pre>
  
  <p>In my app.js I have something like this (some bits missing, my socket.io example):</p>
  
  <pre><code>app.get('/', function (req, res) {
    res.sendfile(__dirname + '/public/index.html');
  });
  
  app.post('/timeout', function (req, res) {
  
    //Find socket, not implemented yet
  
    console.log('I received a private message by ', from, ' saying ', msg);
  
    io.sockets.on('connection', function (socket) {
      io.sockets.emit('this', { will: 'be received by everyone'});        
    });
  
  });
  
  server.listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <p>The route works but when I post, I get nothing bad and no errors - like I said, I'm new to Node from Rails. Am hoping it's something straight forward.</p>
  
  <p>Is is possible to do such a thing? Is this the way to go about it or should I try something else.</p>