8000 Update docs and changelog · Twilio-api/twilio-python@3f6b1b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f6b1b4

Browse files
committed
Update docs and changelog
1 parent ea4f723 commit 3f6b1b4

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
Version 3.6.2
7+
------------
8+
9+
Released on September 24, 2013
10+
11+
- Adds support for HTTP and SOCKS4/5 proxies to the REST client.
12+
13+
14+
Version 3.6.0, 3.6.1
15+
--------------------
16+
17+
Released on September 18, 2013
18+
19+
- Adds support for the new Message and SIP resources to the REST
20+
API client.
21+
- Adds support for the new Message verb to the TwiML generator.
22+
23+
624
Version 3.5.3, 3.5.4
725
--------------------
826

docs/usage/basics.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ directly to the the constructor.
3838
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
3939
4040
41+
Proxies
42+
-------
43+
44+
:class:`TwilioRestClient` supports HTTP and SOCKS4/5 proxies. You can change
45+
the proxy configuration at any time with the :class:`Connection` class:
46+
47+
.. code-block:: python
48+
49+
from twilio.rest.resources import Connection
50+
from twilio.rest.resources.connection import PROXY_TYPE_SOCKS5
51+
52+
Connection.set_proxy_info(
53+
'example.com',
54+
5000,
55+
proxy_type=PROXY_TYPE_SOCKS5,
56+
proxy_user='username',
57+
proxy_pass='password',
58+
)
59+
60+
The :class:`TwilioRestClient` will retrieve and use the current proxy
61+
information for each request.
62+
63+
4164
Listing Resources
4265
-------------------
4366

twilio/rest/resources/connection.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,32 @@
66

77

88
class Connection(object):
9+
'''Class for setting proxy configuration to be used for REST calls.'''
910
_proxy_info = None
1011

1112
@classmethod
1213
def proxy_info(cls):
14+
'''Returns the currently-set proxy information
15+
as an httplib2.ProxyInfo object.
16+
'''
1317
return cls._proxy_info
1418

1519
@classmethod
1620
def set_proxy_info(cls, proxy_host, proxy_port,
1721
proxy_type=PROXY_TYPE_HTTP, proxy_rdns=None,
1822
proxy_user=None, proxy_pass=None):
23+
'''Set proxy configuration for future REST API calls.
24+
25+
:param str proxy_host: Hostname of the proxy to use.
26+
:param int proxy_port: Port to connect to.
27+
:param proxy_type: The proxy protocol to use. One of
28+
PROXY_TYPE_HTTP, PROXY_TYPE_SOCKS4, PROXY_TYPE_SOCKS5.
29+
Defaults to connection.PROXY_TYPE_HTTP.
30+
:param bool proxy_rdns: Use the proxy host's DNS resolver.
31+
:param str proxy_user: Username for the proxy.
32+
:param str proxy_pass: Password for the proxy.
33+
'''
34+
1935
cls._proxy_info = httplib2.ProxyInfo(
2036
proxy_type,
2137
proxy_host,

0 commit comments

Comments
 (0)
0