Hi! Looks really good. I have made something similar by monkey patching the XMLHttpRequest object. I also implemented handling of generators by using Partial content responses: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206 think that allows to have websockets or similar stuff.
Do you know if it is possible to achieve the same with the technique you implemented?