While waiting for 4.x we need this functionality and started developing with the patch in #23 but found it causes an error when init() is called in stream_flush() as it doesn't pass a $scheme argument so rerolled that patch to add defaulting to NULL to the argument.