]> git.ipfire.org Git - thirdparty/tornado.git/commit
Add support for source IP address to SimpleAsyncHTTPClient. 2528/head
authorGasper Zejn <zejn@kiberpipa.org>
Fri, 2 Nov 2018 12:38:22 +0000 (13:38 +0100)
committerGasper Zejn <zejn@kiberpipa.org>
Fri, 2 Nov 2018 12:38:22 +0000 (13:38 +0100)
commit9ba61c636899ed0f7472fb2f4975a53720d1b0ff
treebbd75b59bfd38156478e0e42a4e8f44d96a6b108
parent715ef05682c354e704c7621bfd1a28ad9a52e0d6
Add support for source IP address to SimpleAsyncHTTPClient.

Extend support for HTTPRequest's network_interface parameter to
SimpleAsyncHTTPClient. This enables binding to specific local IP and
enables connecting to WebSockets via a specific IP address.

To use it you create a HTTPRequest with network_interface parameter set
to local IP address to be used as source IP. websocket_connect then
passes the request to SimpleAsyncHTTPClient.

Note that even though the parameter name is `network_interface`, the
CurlAsyncHTTPClient may support (OS dependant) passing in interface
name, resolvable hostname or IP address, while this patch only adds
IP address support to SimpleAsyncHTTPClient.
tornado/httpclient.py
tornado/simple_httpclient.py
tornado/test/httpclient_test.py