MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / makeOnionAndKey

Method makeOnionAndKey

src/Tor/TorManager.py:216–225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 return False
215
216 def makeOnionAndKey(self):
217 res = self.request("ADD_ONION NEW:RSA1024 port=%s" % self.fileserver_port)
218 match = re.search("ServiceID=([A-Za-z0-9]+).*PrivateKey=RSA1024:(.*?)[\r\n]", res, re.DOTALL)
219 if match:
220 onion_address, onion_privatekey = match.groups()
221 return (onion_address, onion_privatekey)
222 else:
223 self.setStatus("AddOnion error (%s)" % res)
224 self.log.error("Tor addOnion error: %s" % res)
225 return False
226
227 def delOnion(self, address):
228 res = self.request("DEL_ONION %s" % address)

Callers 1

addOnionMethod · 0.95

Calls 3

requestMethod · 0.95
setStatusMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected