Update StemPortPlugin.py
This commit is contained in:
parent
8ba684e8c3
commit
ccf2897a65
1 changed files with 10 additions and 2 deletions
|
@ -11,6 +11,10 @@ from Plugin import PluginManager
|
||||||
from Config import config
|
from Config import config
|
||||||
from Debug import Debug
|
from Debug import Debug
|
||||||
|
|
||||||
|
from gevent import monkey
|
||||||
|
monkey.patch_all()
|
||||||
|
print "Patched..."
|
||||||
|
|
||||||
class PatchedControlPort(ControlPort):
|
class PatchedControlPort(ControlPort):
|
||||||
def _make_socket(self):
|
def _make_socket(self):
|
||||||
try:
|
try:
|
||||||
|
@ -56,7 +60,7 @@ class TorManagerPlugin(object):
|
||||||
controller = from_port(port=self.port)
|
controller = from_port(port=self.port)
|
||||||
controller.authenticate()
|
controller.authenticate()
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.status = u"Connected via Stem"
|
self.status = u"Connected (via Stem)"
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
print("\n")
|
print("\n")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
@ -86,10 +90,14 @@ class TorManagerPlugin(object):
|
||||||
try:
|
try:
|
||||||
service = self.controller.create_ephemeral_hidden_service(
|
service = self.controller.create_ephemeral_hidden_service(
|
||||||
{self.fileserver_port: self.fileserver_port},
|
{self.fileserver_port: self.fileserver_port},
|
||||||
await_publication = True
|
await_publication = False
|
||||||
)
|
)
|
||||||
if service.private_key_type != "RSA1024":
|
if service.private_key_type != "RSA1024":
|
||||||
raise Exception("ZeroNet doesn't support crypto " + service.private_key_type)
|
raise Exception("ZeroNet doesn't support crypto " + service.private_key_type)
|
||||||
|
|
||||||
|
self.log.info("Stem created onion service %s.onion" % service.service_id)
|
||||||
|
self.log.info("It takes a few seconds for this onion service to be recognized by HSDirs.")
|
||||||
|
|
||||||
return (service.service_id, service.private_key)
|
return (service.service_id, service.private_key)
|
||||||
|
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
|
|
Loading…
Reference in a new issue