""" Code adapted from Dan Krause. https://gist.github.com/dankrause/6000248 http://github.com/dankrause """ import socket import six from six.moves import http_client ST_DIAL = 'urn:dial-multiscreen-org:service:dial:1' ST_ECP = 'roku:ecp' class _FakeSocket(six.BytesIO): def makefile(self, *args, **kw): return self class SSDPResponse(object): def __init__(self, response): self.location = response.getheader('location') self.usn = response.getheader('usn') self.st = response.getheader('st') self.cache = response.getheader('cache-control').split('=')[1] def __repr__(self): return '