Twisted Network Programming Essentials

Book description

Twisted Network Programming Essentials from O'Reilly is a task-oriented look at this new open source, Python-based technology. The book begins with recommendations for various plug-ins and add-ons to enhance the basic package as installed. It then details Twisted's collection simple network protocols, and helper utilities. The book also includes projects that let you try out the Twisted framework for yourself. For example, you'll find examples of using Twisted to build web services applications using the REST architecture, using XML-RPC, and using SOAP.

Written for developers who want to start building applications using Twisted, this comprehensive guide presents examples of the most common tasks you'll face when building network applications. It also helps you understand the key concepts and design patterns used in Twisted applications. Here are just some of the topics discussed in Twisted Network Programming Essentials:

  • Installing Twisted
  • How to make TCP connections
  • How to use Twisted to work with the Web
  • Twisted's authentication framework
  • Usenet and SSH clients and servers

Along the way, each lesson is supported by thorough notes and explanations to make absolutely certain you're up to speed with this leading-edge Python technology.

Publisher resources

View/Submit Errata

Table of contents

  1. A Note Regarding Supplemental Files
  2. About the Author
  3. Foreword
  4. Preface
    1. Why Use Twisted?
    2. What This Book Covers
    3. Conventions Used in This Book
    4. What You’ll Need
    5. Using Code Examples
    6. Safari® Enabled
    7. How to Contact Us
    8. Acknowledgments
  5. 1. Getting Started
    1. 1.1. Installing Twisted
      1. 1.1.1. How Do I Do That?
        1. 1.1.1.1. Windows
        2. 1.1.1.2. Mac OS X, Linux, and BSD
    2. 1.2. Installing from Source Files
      1. 1.2.1. How Do I Do That?
    3. 1.3. Adding Twisted Utilities to Your Path
      1. 1.3.1. How Do I Do That?
        1. 1.3.1.1. Windows
        2. 1.3.1.2. Linux
        3. 1.3.1.3. Mac OS X
    4. 1.4. Using the Twisted Documentation
      1. 1.4.1. How Do I Do That?
      2. 1.4.2. What About...
    5. 1.5. Finding Answers to Your Questions
      1. 1.5.1. How Do I Do That?
  6. 2. Building Simple Clients and Servers
    1. 2.1. Starting the Twisted Event Loop
      1. 2.1.1. How Do I Do That?
      2. 2.1.2. How Does That Work?
      3. 2.1.3. Establishing a TCP Connection
      4. 2.1.4. How Do I Do That?
      5. 2.1.5. How Does That Work?
    2. 2.2. Working with Asynchronous Results
      1. 2.2.1. How Do I Do That?
      2. 2.2.2. How Does That Work?
      3. 2.2.3. What About...
    3. 2.3. Sending and Receiving Data
      1. 2.3.1. How Do I Do That?
      2. 2.3.2. How Does That Work?
    4. 2.4. Accepting Connections from Clients
      1. 2.4.1. How Do I Do That?
      2. How does that work?
  7. 3. Web Clients
    1. 3.1. Downloading a Web Page
      1. 3.1.1. How Do I Do That?
      2. 3.1.2. How Does That Work?
      3. 3.1.3. What About...
    2. 3.2. Accessing a Password-Protected Page
      1. 3.2.1. How Do I Do That?
      2. 3.2.2. How Does That Work?
    3. 3.3. Uploading a File
      1. 3.3.1. How Do I Do That?
      2. 3.3.2. How Does That Work?
    4. 3.4. Checking Whether a Page Has Changed
      1. 3.4.1. How Do I Do That?
      2. 3.4.2. How Does That Work?
    5. 3.5. Monitoring Download Progress
      1. 3.5.1. How Do I Do That?
      2. 3.5.2. How Does That Work?
  8. 4. Web Servers
    1. 4.1. Responding to HTTP Requests
      1. 4.1.1. How Do I Do That?
      2. 4.1.2. How Does That Work?
    2. 4.2. Parsing HTTP Requests
      1. 4.2.1. How Do I Do That?
      2. 4.2.2. How Does That Work?
    3. 4.3. Working with POST Data from HTML Forms
      1. 4.3.1. How Do I Do That?
      2. 4.3.2. How Does That Work?
    4. 4.4. Managing a Hierarchy of Resources
      1. 4.4.1. How Do I Do That?
      2. 4.4.2. How Does That Work?
    5. 4.5. Storing Web Data in an SQL Database
      1. 4.5.1. How Do I Do That?
      2. 4.5.2. How Does That Work?
    6. 4.6. Running an HTTP Proxy Server
      1. 4.6.1. How Do I Do That?
      2. 4.6.2. How Does That Work?
  9. 5. Web Services and RPC
    1. 5.1. Using the REST Architecture for Web Services
      1. 5.1.1. How Do I Do That?
      2. 5.1.2. How Does That Work?
    2. 5.2. Using a Web Client to Update Resources Through REST
      1. 5.2.1. How Do I Do That?
      2. 5.2.2. How Does That Work?
    3. 5.3. Enabling Web Services Using XML-RPC
      1. 5.3.1. How Do I Do That?
      2. 5.3.2. How Does That Work?
    4. 5.4. Calling XML-RPC Functions
      1. 5.4.1. How Do I Do That?
      2. 5.4.2. How Does That Work?
    5. 5.5. Installing SOAP Libraries
    6. 5.6. Sharing Web Services with SOAP
      1. 5.6.1. How Do I Do That?
      2. 5.6.2. How Does That Work?
    7. 5.7. Calling SOAP Web Services
      1. 5.7.1. How Do I Do That?
      2. 5.7.2. How Does That Work?
    8. 5.8. Sharing Python Objects with Perspective Broker
      1. 5.8.1. How Do I Do That?
      2. 5.8.2. How Does That Work?
  10. 6. Authentication
    1. 6.1. Using Authentication in a Twisted Server
      1. 6.1.1. How Do I Do That?
      2. 6.1.2. How Does That Work?
    2. 6.2. Authenticating Against a Database Table
      1. 6.2.1. How Do I Do That?
      2. 6.2.2. How Does That Work?
    3. 6.3. Representing Users with Different Capabilities
      1. 6.3.1. How Do I Do That?
      2. 6.3.2. How Does That Work?
    4. 6.4. Using Authentication with Perspective Broker
      1. 6.4.1. How Do I Do That?
      2. 6.4.2. How Does That Work?
  11. 7. Mail Clients
    1. 7.1. Downloading Mail from a POP3 Server
      1. 7.1.1. How Do I Do That?
      2. 7.1.2. How Does That Work?
      3. 7.1.3. What About...
    2. 7.2. Sending Mail Using SMTP
      1. 7.2.1. How Do I Do That?
      2. 7.2.2. How Does That Work?
    3. 7.3. Looking Up the SMTP Server for a Domain
      1. 7.3.1. How Do I Do That?
      2. 7.3.2. How Does That Work?
    4. 7.4. Listing Mailboxes on an IMAP Server
      1. 7.4.1. How Do I Do That?
      2. 7.4.2. How Does That Work?
    5. 7.5. Downloading Messages from an IMAP Mailbox
      1. 7.5.1. How Do I Do That?
      2. 7.5.2. How Does That Work?
  12. 8. Mail Servers
    1. 8.1. Accepting Mail with SMTP
      1. 8.1.1. How Do I Do That?
      2. 8.1.2. How Does That Work?
    2. 8.2. Using SMTP as a User Interface
      1. 8.2.1. How Do I Do That?
      2. 8.2.2. How Does That Work?
    3. 8.3. Providing POP3 Access to Mailboxes
      1. 8.3.1. How Do I Do That?
      2. 8.3.2. How Does That Work?
    4. 8.4. Providing IMAP Access to Mailboxes
      1. 8.4.1. How Do I Do That?
      2. 8.4.2. How Does That Work?
        1. 8.4.2.1. IAccount
        2. 8.4.2.2. IMailbox
      3. 8.4.3. IMessagePart and IMessage
      4. 8.4.4. Putting It All Together
  13. 9. NNTP Clients and Servers
    1. 9.1. Listing the Newsgroups on a Server
      1. 9.1.1. How Do I Do That?
      2. 9.1.2. How Does That Work?
    2. 9.2. Downloading Usenet Articles
      1. 9.2.1. How Do I Do That?
      2. 9.2.2. How Does That Work?
    3. 9.3. Posting a Message to an NNTP Server
      1. 9.3.1. How Do I Do That?
      2. 9.3.2. How Does That Work?
    4. 9.4. Running a Basic NNTP Server
      1. 9.4.1. How Do I Do That?
      2. 9.4.2. How Does That Work?
    5. 9.5. Using NNTP as a User Interface
      1. 9.5.1. How Do I Do That?
      2. 9.5.2. How Does That Work?
  14. 10. SSH
    1. 10.1. Setting Up a Custom SSH Server
      1. 10.1.1. How Do I Do That?
      2. 10.1.2. How Does That Work?
    2. 10.2. Using Public Keys for Authentication
      1. 10.2.1. How Do I Do That?
      2. 10.2.2. How Does That Work?
    3. 10.3. Providing an Administrative Python Shell
      1. 10.3.1. How Do I Do That?
      2. 10.3.2. How Does That Work?
    4. 10.4. Running Commands on a Remote Server
      1. 10.4.1. How Do I Do That?
      2. 10.4.2. How Does That Work?
  15. 11. Services, Processes, and Logging
    1. 11.1. Running a Twisted Application as a Daemon
      1. 11.1.1. How Do I Do That?
      2. 11.1.2. How Does That Work?
    2. 11.2. Setting Limits on an Application’s Permissions
      1. 11.2.1. How Do I Do That?
      2. 11.2.2. How Does That Work?
      3. 11.2.3. What About...
    3. 11.3. Managing Multiple Services
      1. 11.3.1. How Do I Do That?
      2. 11.3.2. How Does That Work?
    4. 11.4. Logging Events and Errors
      1. 11.4.1. How Do I Do That?
      2. 11.4.2. How Does That Work?
  16. Index
  17. About the Author
  18. Colophon
  19. Copyright

Product information

  • Title: Twisted Network Programming Essentials
  • Author(s): Abe Fettig
  • Release date: October 2005
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596100322