summaryrefslogtreecommitdiff
path: root/docs/getting_started/proxy.rst
blob: b5e74180dd9398b19a4304d170b5b58d5e870b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.. _proxy:

=========================
Enable HTTP Proxy Support
=========================

.. note::
    
    If you have any issues working through this quickstart guide
    or the other tutorials here, please either send a message to the
    `mailing list <http://groups.google.com/group/slixmpp-discussion>`_
    or join the chat room at `sleek@conference.jabber.org
    <xmpp:sleek@conference.jabber.org?join>`_.

In some instances, you may wish to route XMPP traffic through
an HTTP proxy, probably to get around restrictive firewalls.
Slixmpp provides support for basic HTTP proxying with DIGEST
authentication.

Enabling proxy support is done in two steps. The first is to instruct Slixmpp
to use a proxy, and the second is to configure the proxy details:

.. code-block:: python

    xmpp = ClientXMPP(...)
    xmpp.use_proxy = True
    xmpp.proxy_config = {
        'host': 'proxy.example.com',
        'port': 5555,
        'username': 'example_user',
        'password': '******'
    }

The ``'username'`` and ``'password'`` fields are optional if the proxy does not
require authentication.


The Final Product
-----------------

.. include:: ../../examples/proxy_echo_client.py
    :literal: