Foundations of Python Network Programming

(WallPaper) #1

cipher() method, 107
cipher negotiation, 111
compression() method, 107
features, 93
front-end HTTPS servers, 98
getpeercert() method, 107
HTTP requests, 94
OpenSSL library, 113
PES (see Perfect Forward Security (PFS))
protocol support, 107
Python 3.4 default contexts
(see Python 3.4 default contexts)
safe_tls.py server, 111
set_cipher() method, 112
ssl module, 98
SSLv3 protocol, 111
Twisted server, 171


„„„„„„„„„U, V

Uniform resource identifier (URI), 184
Uniform resource locator (URL)
address bar, 183
features, 184
fragment, 184
parsing and building, 184
query string, 184
relative URLs, 186–187
URNs, 183
Uniform resource names (URNs), 184
Unique identifier (UID), 273
Universally unique identifier (UUID), 227
urllib libraries, 151
urllib.parse module, 184
urlsplit() function, 185
User Datagram Protocol (UDP)
binding interfaces
Ethernet connection/wireless card, 30
external interface, 30
external IP address, 30
IP interface, 31
loopback interface, 30
remote interface, 31
request packet, 31
wildcard IP address, 31
broadcast, 34
fragmentation, 32
IP address, 18
port numbers
arbitrary port, 19
automatic configuration, 18
convention, 18
destination port, 18


getaddrinfo() function, 19
getservbyname() function, 19
manual configuration, 19
multiplexing, 18
registered ports, 19
source port, 18
well-known ports, 19
sockets
bind() command, 21
blocking, 26
client code, 20, 22
clients and unwelcome replies, 23
connection, 28
creation, 21
daemon program, 28
exponential backoff, 26
getattr() function, 34
getsockname() method, 22
Loopback Interface, 20
object-based interface, 19
POSIX socket interface, 33
recvfrom() function, 22
request IDs, 29
server and client, 24, 26
setattr() function, 34
SO_BROADCAST, 34
SO_DONTROUT, 34
SO_TYPE, 34
timeout, 26
unreliability, 26
web browser/SSH client, 21
uses, 36

„„„„„„„„„W

Web scraping
BeautifulSoup, 218
fetching pages
payments application and reports, 214
payments system, 214–215
post() method, 216
Python program, 213
Selenium-based code, 216
session object, 215
get_text() method, 217
HTML, 217
HTTP responses, 212
JavaScript programs, 216
raw scraping, 212
recursive scraping
GET() function, 219–220
HTTP response, 220
POST operation, 220
Selenium Webdriver, 221

■ index


356


Transport layer security (TLS) (cont.)

Free download pdf