Use network sockets together with the Haskell pipes library.