PyXMPP2 Settings

Basic Settings

It is recommended these settings can be configured by the end user, as they may be required for correct operation with a specific service

c2s_port

  • Type: int
  • Default: 5222
  • Command line: --c2s-port C2S_PORT

Port number for client to server connections.

ipv6

  • Type: bool
  • Default: True
  • Command line: --ipv6 | --no-ipv6

Look up IPv6 addresses for a server host name.

password

  • Type: unicode
  • Default: None
  • Command line: --password PASSWORD

A password for password-based SASL mechanisms.

prefer_ipv6

  • Type: bool
  • Default: True
  • Command line: --prefer-ipv6 | --no-prefer-ipv6

When enabled IPv6 and connecting to a dual-stack XMPP server IPv6 addresses will be tried first.

server

  • Type: unicode
  • Default: None
  • Command line: --server SERVER

Server address to connect to. By default a DNS SRV record look-up is done for the requested JID domain part and if that fails - 'A' or 'AAAA' record lookup for the same domain. This setting may be used to force using a specific server or when SRV look-ups are not available.

starttls

  • Type: bool
  • Default: False
  • Command line: --starttls | --no-starttls

Enable StartTLS negotiation.

tls_cacert_file

  • Type: str
  • Default: None
  • Command line: --tls-cacert-file TLS_CACERT_FILE

Path to the TLS CA certificates file. The file should contain the trusted CA certificates in the PEM format, concatenated.

tls_require

  • Type: bool
  • Default: False
  • Command line: --tls-require | --no-tls-require

Require TLS stream encryption.

tls_verify_peer

  • Type: bool
  • Default: True
  • Command line: --tls-verify-peer | --no-tls-verify-peer

Verify the peer certificate.

Extra Settings

These settings can even further change the PyXMPP
behaviour, but in most cases there is no need to set them.

authzid

  • Type: unicode
  • Default: None
  • Command line: --authzid AUTHZID

The authorization-id (alternative JID) to request during the SASL authentication.

c2s_service

  • Type: unicode
  • Default: 'xmpp-client'
  • Command line: --c2s-service C2S_SERVICE

SRV service name for client to server connections.

default_stanza_timeout

  • Type: float
  • Default: 300
  • Command line: --default-stanza-timeout DEFAULT_STANZA_TIMEOUT

Time in seconds to wait for a stanza response.

dns_resolver

The DNS resolver implementation to be used by PyXMPP.

event_queue

Queue used to post events by various components and to dispatch them from the main loop.

event_queue_max_size

  • Type: int
  • Default: 0

Maximum size of the default event loop. Posting events will block when the queue is full. This will cause lock-up of a single-thread, but may be useful in multi-threaded applications.

extra_ns_prefixes

  • Type: prefix -> uri mapping
  • Default: {}

Extra namespace prefix declarations to use at the stream root element.

initial_presence

  • Type: unicode
  • Default: Just Presence()

Default initial presence stanza, to be send on login. Set to None not to send the initial presence.

ipv4

  • Type: bool
  • Default: True
  • Command line: --ipv4 | --no-ipv4

Look up IPv4 addresses for a server host name.

language

  • Type: unicode
  • Default: u'en'
  • Command line: --language LANGUAGE

The preferred language of the XMPP stream.

languages

  • Type: list of unicode
  • Default: [u'en']
  • Command line: --languages LANGUAGES

When the remote entity selects one of these languages on their stream, the same language will be sent in our stream declaration.

password_manager

Object providing or checking user password and other SASL authentication properties.

poll_interval

  • Type: float
  • Default: 1.0
  • Command line: --poll-interval POLL_INTERVAL

Maximum time to wait for an event. Smaller value may increase response times, by the cost of higher CPU usage.

resource

  • Type: unicode
  • Default: None
  • Command line: --resource RESOURCE

JID resource to bind. Use the server-provided resource if not set. Automatically set to the resource of the JID provided to the ClientStream constructor.

roster_group_name_length_limit

  • Type: int
  • Default: 1023

Maximum length of roster group name.

roster_name_length_limit

  • Type: int
  • Default: 1023

Maximum length of roster item name.

sasl_mechanisms

  • Type: list of unicode
  • Default: ['DIGEST-MD5', 'PLAIN']
  • Command line: --sasl-mechanisms SASL_MECHANISMS

SASL mechanism that can be used for stream authentication.

software_name

  • Type: unicode
  • Default: 'PyXMPP2'
  • Command line: --software-name SOFTWARE_NAME

Software name for XEP-0092 query.

software_os

  • Type: unicode
  • Default: Operating system running this code
  • Command line: --software-os SOFTWARE_OS

Operating system name for XEP-0092 query.

software_version

  • Type: unicode
  • Default: u'1.99.0-git'
  • Command line: --software-version SOFTWARE_VERSION

Software version for XEP-0092 query.

tls_cert_file

  • Type: str
  • Default: None
  • Command line: --tls-cert-file TLS_CERT_FILE

Path to the TLS certificate file. The file should contain the certificate, any immediate certificates needed and it may optionally contain the private key. All in the PEM format, concatenated.

tls_key_file

  • Type: str
  • Default: None
  • Command line: --tls-key-file TLS_KEY_FILE

Path to the TLS certificate private key file (in the PEM format). Not needed if the key is included in the file pointed by the tls_cert_file setting.

tls_verify_callback

  • Type: callable
  • Default: <function is_certificate_valid at 0x840c4c4>

A function to verify if a certificate is valid and if the remote party presenting this certificate is authorized to use the stream. The function must accept two arguments: a stream and the certificate to verify.

username

  • Type: unicode
  • Default: None
  • Command line: --username USERNAME

The username to use instead of the JID local part.