2011-12-31 17:33:32 +00:00
|
|
|
.. _proxy:
|
|
|
|
|
|
|
|
=========================
|
2011-08-14 03:58:53 +00:00
|
|
|
Enable HTTP Proxy Support
|
|
|
|
=========================
|
2011-12-31 17:33:32 +00:00
|
|
|
|
|
|
|
.. note::
|
2014-08-17 19:53:34 +00:00
|
|
|
|
2011-12-31 17:33:32 +00:00
|
|
|
If you have any issues working through this quickstart guide
|
2015-02-24 17:58:40 +00:00
|
|
|
join the chat room at `slixmpp@muc.poez.io
|
|
|
|
<xmpp:slixmpp@muc.poez.io?join>`_.
|
2011-12-31 17:33:32 +00:00
|
|
|
|
|
|
|
In some instances, you may wish to route XMPP traffic through
|
|
|
|
an HTTP proxy, probably to get around restrictive firewalls.
|
2014-07-17 12:19:04 +00:00
|
|
|
Slixmpp provides support for basic HTTP proxying with DIGEST
|
2011-12-31 17:33:32 +00:00
|
|
|
authentication.
|
|
|
|
|
2014-07-17 12:19:04 +00:00
|
|
|
Enabling proxy support is done in two steps. The first is to instruct Slixmpp
|
2011-12-31 17:33:32 +00:00
|
|
|
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:
|