reworked to use intermediate http server