File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,24 @@ twilio-python Changelog
3
3
4
4
Here you can see the full list of changes between each twilio-python release.
5
5
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
+
6
24
Version 3.5.3, 3.5.4
7
25
--------------------
8
26
Original file line number Diff line number Diff line change @@ -38,6 +38,29 @@ directly to the the constructor.
38
38
client = TwilioRestClient(ACCOUNT_SID , AUTH_TOKEN )
39
39
40
40
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
+
41
64
Listing Resources
42
65
-------------------
43
66
Original file line number Diff line number Diff line change 6
6
7
7
8
8
class Connection (object ):
9
+ '''Class for setting proxy configuration to be used for REST calls.'''
9
10
_proxy_info = None
10
11
11
12
@classmethod
12
13
def proxy_info (cls ):
14
+ '''Returns the currently-set proxy information
15
+ as an httplib2.ProxyInfo object.
16
+ '''
13
17
return cls ._proxy_info
14
18
15
19
@classmethod
16
20
def set_proxy_info (cls , proxy_host , proxy_port ,
17
21
proxy_type = PROXY_TYPE_HTTP , proxy_rdns = None ,
18
22
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
+
19
35
cls ._proxy_info = httplib2 .ProxyInfo (
20
36
proxy_type ,
21
37
proxy_host ,
1477
You can’t perform that action at this time.
0 commit comments