live-server: extract and rework the HTTP redirector.