def __init__(self, cs): o = urlparse(cs) if o.scheme == 'udp': self.sub = UDPEmitter(o.hostname, o.port) if o.scheme == 'ws': self.sub = WSEmitter(o.hostname, o.port, o.path)