add support for basic auth in endpoint server; switch from urllib2 to requests in listen script