Attoparsec was created specifically for streaming, thus its parsing functions take into account that some portion of the pattern may yet to have arrived and its combinators avoid taking input greedily unintentionally.
It is not clear to me that megaparsec is capable of that. There is a package attoparsec-parsec package, which reimplements parsec's combinators in a way attoparsec can use, but I do not see a version of that for megaparsec. You would have to write every megaparsec combinator into an equivalent attoparsec to create such a package.