node.js - NodeJS How to proxy multiple clients to the same server -
i'm using proxy server stream content flash client cannot around crossdomain issues.
currently have working 1 client, if client requests same url, cannot load content because it's in use.
is possible have multiple clients connecting server , streaming same resource rather separate instances of same resource? improve bandwidth usage. here's current code:
http.createserver(function(req, res) { //i receive req.url in format /url={url} req.url = req.url.replace("/?url=", ""); try { req.pipe(request(req.url)).pipe(res); } catch(e) { //for reason server errors on favicon url requested flv? console.log(":( " + e); } }).listen(8001);
so, question is, possible store result stream , pipe multiple requests?
client ---| |---- proxy server --- external resource | client ---|
Comments
Post a Comment