I need to make a HTTP GET request to foreign server to start receiving events. After request I immediately get multipart/x-mixed-replace response. When an event occurs, it's sent as XML message together with boundary indicating the end of this part.
Now I must implement it in Node.js. With normal request I use node-rest-client, call its get() method and put my logic in method's callback. Trouble is that callback is executed only when response is finished and with multipart/x-mixed-replace it isn't until connection closes.
Is there some other NPM module that does the trick? I searched NPM registry but results I found seem unappropriate to the task. Or is it better to do it in pure Node? I so, please provide an example.