示例#1
0
 def __init__(self,
              stateLocation,
              managedTransportVer=None,
              transports=None,
              proxy=None):
     Config.__init__(self, stateLocation, managedTransportVer, transports)
     self.proxy = proxy
示例#2
0
    def __init__(self):
        Config.__init__(self)

        self.transports = self.get('TOR_PT_CLIENT_TRANSPORTS').split(',')
        if '*' in self.transports:
            self.allTransportsEnabled = True
            self.transports.remove('*')
示例#3
0
 def __init__(self,
              stateLocation,
              managedTransportVer=None,
              transports=None,
              proxy=None):
     Config.__init__(self, stateLocation, managedTransportVer, transports)
     self.proxy = proxy
示例#4
0
文件: util.py 项目: blanu/pyptlib
def checkClientMode():
    """ Checks to see if the daemon has been launched in client mode or server mode. Returns True if it is in client mode, otherwise False. """

    try:
        c = Config()
        return c.checkClientMode()
    except EnvException:
        return False
示例#5
0
文件: util.py 项目: ch3n2k/pyptlib
def checkClientMode(): # XXX WTF!???! This also exists in config.py.
    """
    Check whether Tor wants us to run as a client or as a server.

    :returns: bool -- True if Tor wants us to run as a client.
    """
    try:
        c = Config()
        return c.checkClientMode()
    except EnvError:
        return False
示例#6
0
文件: client.py 项目: blanu/pyptlib
    def __init__(self):  # throws EnvError
        """
        Initialize the ClientConfig object.
        This causes the state location, managed transport, and transports version to be set.
        """

        Config.__init__(self)

        self.transports = self.get('TOR_PT_CLIENT_TRANSPORTS').split(','
                )
        if '*' in self.transports:
            self.allTransportsEnabled = True
            self.transports.remove('*')
示例#7
0
文件: server.py 项目: blanu/pyptlib
    def __init__(self):  # throws EnvError
        """
            Initialize the ClientConfig object.
            This causes the state location, managed transport, and transports version to be set.
        """

        Config.__init__(self)

        self.extendedServerPort = self.get('TOR_PT_EXTENDED_SERVER_PORT'
                )
        orport = self.get('TOR_PT_ORPORT').split(':')
	orport[1]=int(orport[1])
	self.ORPort=orport

        binds = self.get('TOR_PT_SERVER_BINDADDR').split(',')
        for bind in binds:
            (key, value) = bind.split('-')
            self.serverBindAddr[key] = value

        self.transports = self.get('TOR_PT_SERVER_TRANSPORTS').split(','
                )
        if '*' in self.transports:
            self.allTransportsEnabled = True
            self.transports.remove('*')