client-socket-proxy to http response

26 views
Skip to first unread message

Emanuel Lazar

unread,
Aug 5, 2014, 10:42:03 AM8/5/14
to nod...@googlegroups.com
node.js client-socket-proxy to http response

1. socket.connect(PORT,HOST) establish socket connect (client to local tcp server)

2. define http server (req,res)
   from http (req,res) cycle I send data from req.url query string to the socket
   the socket.on('data',...) 
   or even socket.pipe(res)
   not sending the data to http response(res) ,
   until, I close the socket ???

   how the http response 'knows' that the socket is opened ?
   or I don't understand the node.js cycle

3. is there complete code sample how to deal with tcp-client-proxy to http response ?
    without opening/closing the socket on each (req,res) cycle ?

Reply all
Reply to author
Forward
0 new messages