__init__(self,
secret=None,
addr=None,
port=0,
lockfile=None,
timeout=0,
client_timeout=0,
log=None,
mode=' single ' ,
label='
' ,
owner='
' ,
owner_group='
' ,
auth_file=None,
access_restrict=None,
admin=' admin ' ,
https=False,
keyfile=None,
certfile=None,
cert_reqs=0,
ca_certs=None,
ssl_version=2,
web_profile=False)
(Constructor)
|
|
SAMP Hub server constructor. The SSL parameters are usable only if
Python has been compiled with SSL support and/or ssl
module is installed (available by default since Python 2.6).
- Parameters:
secret (string) - Secret code.
addr (string) - Listening address (or IP)
port (int) - Listening port number.
lockfile - Custom lockfile name.
timeout (int) - Hub inactivity timeout. If timeout > 0 then the
Hub automatically stops after an inactivity period longer than
timeout seconds. By default timeout is
set to 0 (Hub never expires).
client_timeout (int) - Client inactivity timeout. If client_timeout > 0
then the Hub automatically unregisters the clients which result
inactive for a period longer than client_timeout
seconds. By default client_timeout is set to 0
(clients never expire).
log (SAMPLog) - a SAMPLog
instance for the Hub logging. If missing then a standard SAMPLog instance
is used.
mode (string) - Defines the Hub running mode. If mode is 'single'
then the Hub runs using the standard {.samp} lock-file, having a
single instance for user desktop session. Otherwise, if
mode is 'multiple', then the Hub runs using a
non-standard lock-file, placed in .samp-1 directory,
of the form samp-hub-<PID>-<ID> , where
<PID> is the process id and
<ID> is a general sub-id (integer number).
label (string) - A string used to label the Hub with a human readable name. This
string is written in the lock-file assigned to the
hub.label token.
owner (string) - General purpose Hub owner name. This value is written in the
lock-file and assigned to the hub.owner.name token.
owner_group (string) - General purpose Hub owner group name. This value is written in
the lock-file and assigned to the hub.owner.group
token.
auth_file (string) - Authentication file path used for Basic Authentication. The
authentication file must be a Berkeley DB file in Hash format
containing a set of <user
name>=md5(<password>)<group 1>,<group
2>,<group 3>,...) key/value pairs.
access_restrict (string) - Define whether the Hub access must be restricted to the Hub
owner, to a certain owner group or not restricted at all. Values
accepted: SAMP_RESTRICT_OWNER, SAMP_RESTRICT_GROUP, None
admin (string) - Define the name of the administrator user in case of restricted
access. The administrator user can always access the hub instance
even if it is running with SAMP_RESTRICT_OWNER policy. The administrator
must be declared in the authentication file.
https (boolean) - set the Hub running on a Secure Sockets Layer connection (HTTPS).
By default SSL is desabled.
keyfile (string) - Set the file containing the private key for SSL connections. If
the certificate file (certfile ) contains the private
key, then keyfile can be omitted.
certfile (string) - Specify the file which contains a certificate to be used to
identify the local side of the secure connection.
cert_reqs (int) - The parameter cert_reqs specifies whether a
certificate is required from the client side of the connection,
and whether it will be validated if provided. It must be one of
the three values ssl.CERT_NONE
(certificates ignored), ssl.CERT_OPTIONAL (not required, but
validated if provided), or ssl.CERT_REQUIRED (required and validated).
If the value of this parameter is not ssl.CERT_NONE , then the ca_certs
parameter must point to a file of CA certificates.
ca_certs (string) - The ca_certs file contains a set of concatenated
"Certification Authority" certificates, which are used
to validate certificates passed from the client end of the
connection.
ssl_version (int) - The ssl_version option specifies which version of
the SSL protocol to use. Typically, the server chooses a
particular protocol version, and the client must adapt to the
server's choice. Most of the versions are not interoperable
with the other versions. If not specified the default SSL version
is ssl.PROTOCOL_SSLv23 . This version
provides the most compatibility with other versions client side.
Other SSL protocol versions are: ssl.PROTOCOL_SSLv2 , ssl.PROTOCOL_SSLv3 and ssl.PROTOCOL_TLSv1 .
web_profile - The web_profile option enables/disables the Web
Profile support.
- Overrides:
object.__init__
|