implements http keepalive