2012-11-14から1日間の記事一覧

readStream.pipe( duplexStream ).pipe(writableStream) してみた

Re:node.jsでストリーミング的な - .blog これ書いた後に HTTP_Request.pipe(MyDuplexStream).pipe(HTTP_Response); させたくなった。 実際には、HTTP_Request.on('data')時のデータをそのまま HTTP_Responseに流すわけじゃないのでデータを変換するストリー…

Re:node.jsでストリーミング的な

node.jsでストリーミング的な - 四角革命前夜インプット(fs.ReadStream)もアウトプット(http.ServerResponse)もStream実装だし、pipe使うのが楽じゃないかと思った。 こんなかんじでどうですかね? var http = require('http') , url = require('url') , pat…