> **Источник:** https://python-all.ru/3.1/library/internet.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# 20. Интернет-протоколы и поддержка

Модули, описанные в этой главе, реализуют интернет-протоколы и поддержку смежных технологий. Все они реализованы на Python. Большинство этих модулей требуют наличия системно-зависимого модуля [`socket`](https://python-all.ru/3.1/library/socket.html#module-socket), который в настоящее время поддерживается на большинстве популярных платформ. Здесь представлен обзор:

- [20.1. `webbrowser` – Удобный контроллер веб-браузера](https://python-all.ru/3.1/library/webbrowser.html)

  - [20.1.1. Объекты контроллера браузера](https://python-all.ru/3.1/library/webbrowser.html#browser-controller-objects)
- [20.2. `cgi` – Поддержка Common Gateway Interface](https://python-all.ru/3.1/library/cgi.html)

  - [20.2.1. Введение](https://python-all.ru/3.1/library/cgi.html#introduction)
  - [20.2.2. Использование модуля cgi](https://python-all.ru/3.1/library/cgi.html#using-the-cgi-module)
  - [20.2.3. Интерфейс высокого уровня](https://python-all.ru/3.1/library/cgi.html#higher-level-interface)
  - [20.2.4. Функции](https://python-all.ru/3.1/library/cgi.html#functions)
  - [20.2.5. Вопросы безопасности](https://python-all.ru/3.1/library/cgi.html#caring-about-security)
  - [20.2.6. Установка CGI-скрипта в системе Unix](https://python-all.ru/3.1/library/cgi.html#installing-your-cgi-script-on-a-unix-system)
  - [20.2.7. Тестирование CGI-скрипта](https://python-all.ru/3.1/library/cgi.html#testing-your-cgi-script)
  - [20.2.8. Отладка CGI-скриптов](https://python-all.ru/3.1/library/cgi.html#debugging-cgi-scripts)
  - [20.2.9. Распространённые проблемы и их решения](https://python-all.ru/3.1/library/cgi.html#common-problems-and-solutions)
- [20.3. `cgitb` – Менеджер трассировки для CGI-скриптов](https://python-all.ru/3.1/library/cgitb.html)
- [20.4. `wsgiref` – Утилиты WSGI и эталонная реализация](https://python-all.ru/3.1/library/wsgiref.html)

  - [20.4.1. `wsgiref.util` – Утилиты окружения WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.util)
  - [20.4.2. `wsgiref.headers` – Инструменты для заголовков ответов WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.headers)
  - [20.4.3. `wsgiref.simple_server` – Простой HTTP-сервер WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.simple_server)
  - [20.4.4. `wsgiref.validate` – Проверка соответствия WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.validate)
  - [20.4.5. `wsgiref.handlers` – Базовые классы сервера/шлюза](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.handlers)
  - [20.4.6. Примеры](https://python-all.ru/3.1/library/wsgiref.html#examples)
- [20.5. `urllib.request` – Расширяемая библиотека для открытия URL](https://python-all.ru/3.1/library/urllib.request.html)

  - [20.5.1. Объекты Request](https://python-all.ru/3.1/library/urllib.request.html#request-objects)
  - [20.5.2. Объекты OpenerDirector](https://python-all.ru/3.1/library/urllib.request.html#openerdirector-objects)
  - [20.5.3. Объекты BaseHandler](https://python-all.ru/3.1/library/urllib.request.html#basehandler-objects)
  - [20.5.4. Объекты HTTPRedirectHandler](https://python-all.ru/3.1/library/urllib.request.html#httpredirecthandler-objects)
  - [20.5.5. Объекты HTTPCookieProcessor](https://python-all.ru/3.1/library/urllib.request.html#httpcookieprocessor-objects)
  - [20.5.6. Объекты ProxyHandler](https://python-all.ru/3.1/library/urllib.request.html#proxyhandler-objects)
  - [20.5.7. Объекты HTTPPasswordMgr](https://python-all.ru/3.1/library/urllib.request.html#httppasswordmgr-objects)
  - [20.5.8. Объекты AbstractBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#abstractbasicauthhandler-objects)
  - [20.5.9. Объекты HTTPBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#httpbasicauthhandler-objects)
  - [20.5.10. Объекты ProxyBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#proxybasicauthhandler-objects)
  - [20.5.11. Объекты AbstractDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#abstractdigestauthhandler-objects)
  - [20.5.12. Объекты HTTPDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#httpdigestauthhandler-objects)
  - [20.5.13. Объекты ProxyDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#proxydigestauthhandler-objects)
  - [20.5.14. Объекты HTTPHandler](https://python-all.ru/3.1/library/urllib.request.html#httphandler-objects)
  - [20.5.15. Объекты HTTPSHandler](https://python-all.ru/3.1/library/urllib.request.html#httpshandler-objects)
  - [20.5.16. Объекты FileHandler](https://python-all.ru/3.1/library/urllib.request.html#filehandler-objects)
  - [20.5.17. Объекты FTPHandler](https://python-all.ru/3.1/library/urllib.request.html#ftphandler-objects)
  - [20.5.18. Объекты CacheFTPHandler](https://python-all.ru/3.1/library/urllib.request.html#cacheftphandler-objects)
  - [20.5.19. Объекты UnknownHandler](https://python-all.ru/3.1/library/urllib.request.html#unknownhandler-objects)
  - [20.5.20. Объекты HTTPErrorProcessor](https://python-all.ru/3.1/library/urllib.request.html#httperrorprocessor-objects)
  - [20.5.21. Примеры](https://python-all.ru/3.1/library/urllib.request.html#examples)
  - [20.5.22. `urllib.request` Ограничения](https://python-all.ru/3.1/library/urllib.request.html#urllib-request-restrictions)
- [20.6. `urllib.response` – Классы ответов, используемые urllib](https://python-all.ru/3.1/library/urllib.request.html#module-urllib.response)
- [20.7. `urllib.parse` – Разбор URL на компоненты](https://python-all.ru/3.1/library/urllib.parse.html)

  - [20.7.1. Результаты `urlparse()` и `urlsplit()`](https://python-all.ru/3.1/library/urllib.parse.html#results-of-urlparse-and-urlsplit)
- [20.8. `urllib.error` – Классы исключений, вызываемые urllib.request](https://python-all.ru/3.1/library/urllib.error.html)
- [20.9. `urllib.robotparser` – Парсер для robots.txt](https://python-all.ru/3.1/library/urllib.robotparser.html)
- [20.10. `http.client` – Клиент протокола HTTP](https://python-all.ru/3.1/library/http.client.html)

  - [20.10.1. Объекты HTTPConnection](https://python-all.ru/3.1/library/http.client.html#httpconnection-objects)
  - [20.10.2. Объекты HTTPResponse](https://python-all.ru/3.1/library/http.client.html#httpresponse-objects)
  - [20.10.3. Примеры](https://python-all.ru/3.1/library/http.client.html#examples)
  - [20.10.4. Объекты HTTPMessage](https://python-all.ru/3.1/library/http.client.html#httpmessage-objects)
- [20.11. `ftplib` – Клиент протокола FTP](https://python-all.ru/3.1/library/ftplib.html)

  - [20.11.1. Объекты FTP](https://python-all.ru/3.1/library/ftplib.html#ftp-objects)
- [20.12. `poplib` – Клиент протокола POP3](https://python-all.ru/3.1/library/poplib.html)

  - [20.12.1. Объекты POP3](https://python-all.ru/3.1/library/poplib.html#pop3-objects)
  - [20.12.2. Пример POP3](https://python-all.ru/3.1/library/poplib.html#pop3-example)
- [20.13. `imaplib` – Клиент протокола IMAP4](https://python-all.ru/3.1/library/imaplib.html)

  - [20.13.1. Объекты IMAP4](https://python-all.ru/3.1/library/imaplib.html#imap4-objects)
  - [20.13.2. Пример IMAP4](https://python-all.ru/3.1/library/imaplib.html#imap4-example)
- [20.14. `nntplib` – Клиент протокола NNTP](https://python-all.ru/3.1/library/nntplib.html)

  - [20.14.1. Объекты NNTP](https://python-all.ru/3.1/library/nntplib.html#nntp-objects)
- [20.15. `smtplib` – Клиент протокола SMTP](https://python-all.ru/3.1/library/smtplib.html)

  - [20.15.1. Объекты SMTP](https://python-all.ru/3.1/library/smtplib.html#smtp-objects)
  - [20.15.2. Пример SMTP](https://python-all.ru/3.1/library/smtplib.html#smtp-example)
- [20.16. `smtpd` – SMTP-сервер](https://python-all.ru/3.1/library/smtpd.html)

  - [20.16.1. Объекты SMTPServer](https://python-all.ru/3.1/library/smtpd.html#smtpserver-objects)
  - [20.16.2. Объекты DebuggingServer](https://python-all.ru/3.1/library/smtpd.html#debuggingserver-objects)
  - [20.16.3. Объекты PureProxy](https://python-all.ru/3.1/library/smtpd.html#pureproxy-objects)
  - [20.16.4. Объекты MailmanProxy](https://python-all.ru/3.1/library/smtpd.html#mailmanproxy-objects)
- [20.17. `telnetlib` – Telnet-клиент](https://python-all.ru/3.1/library/telnetlib.html)

  - [20.17.1. Объекты Telnet](https://python-all.ru/3.1/library/telnetlib.html#telnet-objects)
  - [20.17.2. Пример Telnet](https://python-all.ru/3.1/library/telnetlib.html#telnet-example)
- [20.18. `uuid` – объекты UUID по RFC 4122](https://python-all.ru/3.1/library/uuid.html)

  - [20.18.1. Пример](https://python-all.ru/3.1/library/uuid.html#example)
- [20.19. `socketserver` – каркас для сетевых серверов](https://python-all.ru/3.1/library/socketserver.html)

  - [20.19.1. Замечания по созданию сервера](https://python-all.ru/3.1/library/socketserver.html#server-creation-notes)
  - [20.19.2. Объекты сервера](https://python-all.ru/3.1/library/socketserver.html#server-objects)
  - [20.19.3. Объекты RequestHandler](https://python-all.ru/3.1/library/socketserver.html#requesthandler-objects)
  - [20.19.4. Примеры](https://python-all.ru/3.1/library/socketserver.html#examples)

    - [20.19.4.1. Пример `socketserver.TCPServer`](https://python-all.ru/3.1/library/socketserver.html#socketserver-tcpserver-example)
    - [20.19.4.2. Пример `socketserver.UDPServer`](https://python-all.ru/3.1/library/socketserver.html#socketserver-udpserver-example)
    - [20.19.4.3. Асинхронные миксины](https://python-all.ru/3.1/library/socketserver.html#asynchronous-mixins)
- [20.20. `http.server` – HTTP-серверы](https://python-all.ru/3.1/library/http.server.html)
- [20.21. `http.cookies` – управление состоянием HTTP](https://python-all.ru/3.1/library/http.cookies.html)

  - [20.21.1. Объекты Cookie](https://python-all.ru/3.1/library/http.cookies.html#cookie-objects)
  - [20.21.2. Объекты Morsel](https://python-all.ru/3.1/library/http.cookies.html#morsel-objects)
  - [20.21.3. Пример](https://python-all.ru/3.1/library/http.cookies.html#example)
- [20.22. `http.cookiejar` – обработка cookie для HTTP-клиентов](https://python-all.ru/3.1/library/http.cookiejar.html)

  - [20.22.1. Объекты CookieJar и FileCookieJar](https://python-all.ru/3.1/library/http.cookiejar.html#cookiejar-and-filecookiejar-objects)
  - [20.22.2. Подклассы FileCookieJar и взаимодействие с веб-браузерами](https://python-all.ru/3.1/library/http.cookiejar.html#filecookiejar-subclasses-and-co-operation-with-web-browsers)
  - [20.22.3. Объекты CookiePolicy](https://python-all.ru/3.1/library/http.cookiejar.html#cookiepolicy-objects)
  - [20.22.4. Объекты DefaultCookiePolicy](https://python-all.ru/3.1/library/http.cookiejar.html#defaultcookiepolicy-objects)
  - [20.22.5. Объекты Cookie](https://python-all.ru/3.1/library/http.cookiejar.html#cookie-objects)
  - [20.22.6. Примеры](https://python-all.ru/3.1/library/http.cookiejar.html#examples)
- [20.23. `xmlrpc.client` – клиентский доступ к XML-RPC](https://python-all.ru/3.1/library/xmlrpc.client.html)

  - [20.23.1. Объекты ServerProxy](https://python-all.ru/3.1/library/xmlrpc.client.html#serverproxy-objects)
  - [20.23.2. Объекты DateTime](https://python-all.ru/3.1/library/xmlrpc.client.html#datetime-objects)
  - [20.23.3. Двоичные объекты](https://python-all.ru/3.1/library/xmlrpc.client.html#binary-objects)
  - [20.23.4. Объекты Fault](https://python-all.ru/3.1/library/xmlrpc.client.html#fault-objects)
  - [20.23.5. Объекты ProtocolError](https://python-all.ru/3.1/library/xmlrpc.client.html#protocolerror-objects)
  - [20.23.6. Объекты MultiCall](https://python-all.ru/3.1/library/xmlrpc.client.html#multicall-objects)
  - [20.23.7. Вспомогательные функции](https://python-all.ru/3.1/library/xmlrpc.client.html#convenience-functions)
  - [20.23.8. Пример использования клиента](https://python-all.ru/3.1/library/xmlrpc.client.html#example-of-client-usage)
  - [20.23.9. Пример использования клиента и сервера](https://python-all.ru/3.1/library/xmlrpc.client.html#example-of-client-and-server-usage)
- [20.24. `xmlrpc.server` – Базовые XML-RPC-серверы](https://python-all.ru/3.1/library/xmlrpc.server.html)

  - [20.24.1. Объекты SimpleXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#simplexmlrpcserver-objects)

    - [20.24.1.1. Пример SimpleXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#simplexmlrpcserver-example)
  - [20.24.2. CGIXMLRPCRequestHandler](https://python-all.ru/3.1/library/xmlrpc.server.html#cgixmlrpcrequesthandler)
  - [20.24.3. Документирование XMLRPC-сервера](https://python-all.ru/3.1/library/xmlrpc.server.html#documenting-xmlrpc-server)
  - [20.24.4. Объекты DocXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#docxmlrpcserver-objects)
  - [20.24.5. DocCGIXMLRPCRequestHandler](https://python-all.ru/3.1/library/xmlrpc.server.html#doccgixmlrpcrequesthandler)
