MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / getOnion

Method getOnion

src/Tor/TorManager.py:276–292  ·  view source on GitHub ↗
(self, site_address)

Source from the content-addressed store, hash-verified

274 return CryptRsa.privatekeyToPublickey(self.privatekeys[address])
275
276 def getOnion(self, site_address):
277 if not self.enabled:
278 return None
279
280 if config.tor == "always": # Different onion for every site
281 onion = self.site_onions.get(site_address)
282 else: # Same onion for every site
283 onion = self.site_onions.get("global")
284 site_address = "global"
285
286 if not onion:
287 with self.lock:
288 self.site_onions[site_address] = self.addOnion()
289 onion = self.site_onions[site_address]
290 self.log.debug("Created new hidden service for %s: %s" % (site_address, onion))
291
292 return onion
293
294 # Creates and returns a
295 # socket that has connected to the Tor Network

Callers 7

startOnionsMethod · 0.95
getConnectedPeersMethod · 0.80
getHandshakeInfoMethod · 0.80
getConnectionMethod · 0.80
testConnectionMethod · 0.80
testSiteOnionMethod · 0.80
announceTrackerZeroMethod · 0.80

Calls 2

addOnionMethod · 0.95
getMethod · 0.45

Tested by 2

testConnectionMethod · 0.64
testSiteOnionMethod · 0.64