Network Programming in Python: The Basic: A Detailed Guide to Python 3 Network Programming and Management (English Edition)
β Scribed by John Galbraith
- Publisher
- BPB Publications
- Year
- 2022
- Tongue
- English
- Leaves
- 544
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
For programmers who need to use Python for network-related activities and apps
Key Features
β Comprehensive coverage of Python 3's improved SSL support.
β Create an asynchronous I/O loop on your own.
β A look at the "asyncio" framework, which is included with Python 3.4.
Description
This book includes revisions for Python 3 as well as all of the classic topics covered, such as network protocols, network data and errors, email, server architecture, and HTTP and web applications.
β Comprehensive coverage of Python 3's improved SSL support
β How to create an asynchronous I/O loop on your own.
β A look at the "asyncio" framework, which is included with Python 3.4.
β The Flask web framework's URL-to-Python code connection.
β How to safeguard your website from cross-site scripting and cross-site request forgery attacks.
β How Django, a full-stack web framework, can automate the round journey from your database to the screen and back.
What you will learn
β Asynchronous models and socket-based networks
β Monitor distant systems using Telnet and SSH connections
β Interact with websites using XML-RPC, SOAP, and REST APIs
β Configure virtual networks in various deployment scenarios
β Analyze security weaknesses in a network
Who this book is for
This book is for Python programmers who need a thorough understanding of how to use Python for network-related activities and applications. This book covers all you need to know about web application development, systems integration, and system administration.
Table of Contents
1. Client- Server Networking: An Overview
2. UDP(User Datagram Protocol)
3. Transmission control protocol (TCP)
4. Domain name system & socket names
5. Data and Errors on the Internet
6. SSL/TLS
7. Architecture of the Server
8. Message Queues and Caches
9. HTTP Clients
10. Servers that handle HTTP
11. www (world wide web)
12. E-mail Construction And Parsing
13.Simple Mail Transfer Protocol(SMTP)
14. Post Office Protocol (POP)
15. Internet Message Access Protocol (IMAP)
16. SSH and Telnet
17. File Transfer Protocol (FTP)
18. Remote Procedure Call (RPC)
β¦ Table of Contents
Cover Page
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgements
Preface
Errata
Table of Contents
1. Client-Server Networking: An Overview
Structure
Objective
The Foundation: Stacks and Libraries
Layers of Application
Talking a protocol
A Network Conversation in its Natural State
Turtles, Turtles, Turtles
The process of encoding and decoding
The Internet Protocol (IP)
Internet Protocol (IP Addresses)
Routing
Fragmentation of packets
Learning More About internet protocol
Conclusion
2. UDP(User Datagram Protocol)
Structure
Objective
Numbers of particular service on the particular system.
Communications connection point (Socket)
Clients who are promiscuous and unwelcome responses
Backoff, blocking, and timeouts are all examples of unreliability.
UDP Socket Connection
The Use of Request IDs Is a Good Idea
From Binding till Interfaces
Fragmentation of UDP
Options for Sockets
Broadcast
When Should We Use UDP?
Conclusion
3. Transmission control protocol (TCP)
Structure
Objective
How transmission control protocol works
When to use transmission control protocol
TCP Sockets Mean?
TCP Client and Server
Each conversation one socket.
Address that is in use.
From Binding to Interfaces
Deadlock
Half-Open Connections, Closed Connections
TCP Streams as Files
Conclusion
4. Domain name system & socket names
Structure
Objective
Sockets and Hostnames
Five Socket Coordinates
IPv6
Modern Address Resolution
Bind Your Server to a Port Using getaddrinfo()
To connect to a service, use getaddrinfo().
Getting a Canonical Hostname with getaddrinfo()
Other getaddrinfo() Flags
Primitive Name Service Routines
In Your Own Code, Use getsockaddr()
DNS Protocol
Why Shouldnβt Use Raw DNS?
Using Python to do a DNS query
Getting Mail Domains Resolved
Conclusion.
5. Data and Errors on the Internet
Structure
Objectives
Strings and Bytes
Character Strings
Network Byte Order and Binary Numbers
Quoting and framing
Pickles and Self-delimiting Formats
JSON And XML
Compression
Exceptions in the Network
Raising More Specific Exceptions
Network Exceptions: Detecting and Reporting
Conclusion
6. SSL/TLS
Structure
Objectives
What TLS Fails to Secure
What Is the Worst That Could Happen?
Producing Certificates
TLS Offloading
Default Contexts in Python 3.4
Wrapping Sockets in Different Ways
Ciphers chosen by hand and perfect forward security
Support for TLS Protocol
Details of Studying
Conclusion
7. Architecture of the Server
Structure
Objectives
A Few Remarks on Deployment
A Basic Protocol
A single-threaded server.
Multiprocess and Threaded Servers
The SocketServer Framework of the Past
Async Servers
Callback-Style asyncio
Coroutine-Style asyncio
The asyncore Legacy Module
The Best of Both Worlds
Under the Influence of inetd
Conclusion
8. Message Queues and Caches
Structure
Objectives
Using Memcached (memory caching)
Hashing and Sharding
Message Queues
Using Pythonβs Message Queues
Conclusion
9. HTTP Clients
Structure
Objectives
Python Client Libraries
Framing, Encryption, and Ports
Methods
Hosts and Paths
Status Codes
Validation and Caching
Encoding of Content
Negotiation of Content
Type of Content
Authentication over HTTP
Cookies
Keep-Alive, Connections, and httplib
Conclusion
10. Servers that handle HTTP
Structure
Objectives
Web Server Gateway Interface (WSGI)
Server-Frameworks that are asynchronous
Proxies (Forward and Reverse)
four architecture style.
Python on Apache
Pure-Python HTTP Servers on the Rise
The Advantages of Reverse Proxies
Platforms as a Service (PaaS)
The REST Question and GET and POST Patterns
Web Server Gateway Interface (WSGI )Without a Framework
Conclusion
11. www (world wide web)
Structure
Objectives
URLs and hypermedia
Creating and Parsing URLs
URLs that are relative
HTML(Hypertext Markup language )
Using a Database to Read and Write
A Horrible Internet Program (in Flask)
The HTTP Methods and Forms Of Dance
When Forms Use Inappropriate Methods
Cookies that are safe and those that are not
Cross-Site Scripting that isnβt persistent
Cross-Site Scripting that Remains Persistent
Forgery of Cross-Site Requests
The Enhanced Software
Djangoβs Payments Application
Choosing a Framework for a Website
WebSockets
Scraping the Internet
Obtaining Pages
Pages for Scraping
Recursive Scraping
Conclusion
12. E-mail Construction And Parsing
Structure
Objectives
Format of an Email Message
Putting Together an E-Mail Message
HTML and Multimedia Enhancement
Content Creation
E-mail Message Parsing
MIME Parts on the Move
Encodings for Headers
Dates Parsing
Conclusion
13. Simple Mail Transfer Protocol(SMTP)
Structure
Objectives
Webmail Services vs. E-mail Clients
The Command Line Was the Beginning
Clients are on the rise
The Transition to Webmail
SMTPβs Functions
E-mail transmission
The Envelope Recipient and the Headers
Several Hops
The SMTP Library is an introduction to the SMTP protocol
Error Handling and Debugging Conversations
Using EHLO to Gather Information
Secure Sockets Layer (SSL) and Transport Layer Security (TLS)
SMTP authentication
SMTP Pointers
Conclusion
14. Post Office Protocol(POP)
Structure
Objectives
Compatibility of POP Servers
Authenticating and connecting
Getting Access to Mailbox Information
Messages are downloaded and deleted.
Conclusion
15. Internet Message Access Protocol (IMAP)
Structure
Objectives
IMAP in Python: An Overview
IMAPClient
Folder Inspection
UIDs vs. Message Numbers
Message Intervals
Information in Brief
Obtaining a Complete Mailbox
Individual Message Downloading
Messages Can Be Flagged and Deleted
Messages Can Be Deleted
Searching
Folders and Messages Manipulation
Asynchrony
Conclusion
16. SSH and Telnet
Structure
Objectives
Automation using the command line
Expansion of the Command Line and Quoting
Arguments to Unix commands can contain (almost) any character.
Characters Iβve Quoted for Protection
Windowsβ Horrible Command Line
In a terminal, things are different.
Terminals are responsible for buffering
Telnet
SSH: The Secure Shell
SSH: A Quick Overview
Host Keys for SSH
Authentication with SSH
Individual Commands and Shell Sessions
SFTP (SSH File Transfer Protocol)
Additional Features
Conclusion
17. File Transfer Protocol (FTP)
Structure
Objectives
What to Do If You Canβt Use FTP
Channels of Communication
In Python, how to use FTP
Binary and ASCII Files
Binary Downloading (Advanced)
Data Uploading
Uploading Binary Data in an Advanced Way
Error Handling
Searching via directories
Detecting Directories and Downloading in Recursive Mode
Creating and deleting directories
Using FTP in a Secure Manner
Conclusion
18. Remote Procedure Call (RPC)
Structure
Objectives
RPCβs characteristics
XML-RPC
JSON-RPC
Data that Documents Itself
Talking About Objects: Pyro and RPyC
An RPyC Example
Message Queues, RPC, and Web Frameworks
Errors in the Network: How to Recover
Conclusion
π SIMILAR VOLUMES
<div> <p style="font-weight: bold">For programmers who need to use Python for network-related activities and apps</p> <h3>Key Features</h3> <ul><li>Comprehensive coverage of Python 3's improved SSL support.</li> <li>Create an asynchronous I/O loop on your own.</li> <li>A look at the "asyncio" f
Conquer the Network Maze: Unleash Agility and Efficiency with Network Programmability and Automation with Python Drowning in a sea of repetitive network configurations? Struggling to keep pace with the ever-growing demands of your network? Network Programmability and Automation with Python is your
<p>Β </p><p>If you want to learn the most modern programming language in the world, then keep reading. Python is an high-level programming language.Β It's a modern language, easy to learn and understand but very powerful.</p><p>It's a versatile programming language that is now being used on a lot o
You will learn fundamentals like IP, TCP, DNS and SSL by using working Python programs; you will also be able to familiarize yourself with infrastructure components like memcached and message queues. You can also delve into network server designs, and compare threaded approaches with asynchronous ev
<p> This second edition of Foundations of Python Network Programming targets Python 2.5 through Python 2.7, the most popular production versions of the language. Python has made great strides since Apress released the first edition of this book back in the days of Python 2.3. The advances requir