# 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`

Port number for client to server connections.

## ipv6

> - Type: `bool`
> - Default: `True`

Look up IPv6 addresses for a server host name.

## password

> - Type: `unicode`
> - Default: `None`

A password for password-based SASL mechanisms.

## prefer_ipv6

> - Type: `bool`
> - Default: `True`

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

## server

> - Type: `unicode`
> - Default: `None`

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`

Enable StartTLS negotiation.

## tls_cacert_file

> - Type: `str`
> - Default: `None`

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`

Require TLS stream encryption.

## tls_verify_peer

> - Type: `bool`
> - Default: `True`

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`

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

## base_c2s_handlers

> - Type: list of handler objects
> - Default: A `StreamSASLHandler` and a `ResourceBindingHandler` instance

The basic handlers used by a `ClientStream` in addition to the handlers provides in the constructor invocation.

## base_client_handlers

> - Type: list of handler objects
> - Default: A `StreamTLSHandler` and a `SessionHandler` instance

The basic handlers used by a `Client` object in addition to the handlers provides in the constructor invocation.

## c2s_service

> - Type: `unicode`
> - Default: `'xmpp-client'`

SRV service name for client to server connections.

## default_stanza_timeout

> - Type: `float`
> - Default: `300`

Time in seconds to wait for a stanza response.

## event_queue

> - Type: `Queue.Queue`
> - Default: A `Queue.Queue` instance

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

## event_queue_max_size

> - Type: `int`
> - Default: `None`

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.

## ipv4

> - Type: `bool`
> - Default: `True`

Look up IPv4 addresses for a server host name.

## language

> - Type: `unicode`
> - Default: `u'en'`

The preferred language of the XMPP stream.

## languages

> - Type: list of `unicode`
> - Default: `[u'en']`

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

## password_manager

> - Type: `pyxmpp2.sasl.core.PasswordManager`
> - Default: A `DefaultPasswordManager` instance

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

## poll_interval

> - Type: `float`
> - Default: `1.0`

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

## resolver

> - Type: `pyxmpp2.interfaces.Resolver`
> - Default: A `BlockingResolver` instance

The DNS resolver implementation to be used by PyXMPP.

## resource

> - Type: `unicode`
> - Default: `None`

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.

## sasl_mechanisms

> - Type: list of `unicode`
> - Default: `['DIGEST-MD5', 'PLAIN']`

SASL mechanism that can be used for stream authentication.

## tls_cert_file

> - Type: `str`
> - Default: `None`

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`

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 0x825a1ec>`

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`

The username to use instead of the JID local part.