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 ?