internet.md
1> **Источник:** https://python-all.ru/2.7/library/internet.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# 20. Интернет-протоколы и поддержка89Модули, описанные в этой главе, реализуют интернет-протоколы и поддержку связанных технологий. Все они реализованы на Python. Большинству из этих модулей требуется наличие системно-зависимого модуля [`socket`](https://python-all.ru/2.7/library/socket.html#module-socket), который в настоящее время поддерживается на большинстве популярных платформ. Вот обзор:1011- [20.1. `webbrowser` – Удобный контроллер веб-браузера](https://python-all.ru/2.7/library/webbrowser.html)1213 - [20.1.1. Объекты контроллера браузера](https://python-all.ru/2.7/library/webbrowser.html#browser-controller-objects)14- [20.2. `cgi` – Поддержка Common Gateway Interface](https://python-all.ru/2.7/library/cgi.html)1516 - [20.2.1. Введение](https://python-all.ru/2.7/library/cgi.html#introduction)17 - [20.2.2. Использование модуля cgi](https://python-all.ru/2.7/library/cgi.html#using-the-cgi-module)18 - [20.2.3. Интерфейс высокого уровня](https://python-all.ru/2.7/library/cgi.html#higher-level-interface)19 - [20.2.4. Устаревшие классы](https://python-all.ru/2.7/library/cgi.html#old-classes)20 - [20.2.5. Функции](https://python-all.ru/2.7/library/cgi.html#functions)21 - [20.2.6. Забота о безопасности](https://python-all.ru/2.7/library/cgi.html#caring-about-security)22 - [20.2.7. Установка CGI-скрипта в системе Unix](https://python-all.ru/2.7/library/cgi.html#installing-your-cgi-script-on-a-unix-system)23 - [20.2.8. Тестирование CGI-сценария](https://python-all.ru/2.7/library/cgi.html#testing-your-cgi-script)24 - [20.2.9. Отладка CGI-сценариев](https://python-all.ru/2.7/library/cgi.html#debugging-cgi-scripts)25 - [20.2.10. Типичные проблемы и их решения](https://python-all.ru/2.7/library/cgi.html#common-problems-and-solutions)26- [20.3. `cgitb` – Менеджер трассировки для CGI-сценариев](https://python-all.ru/2.7/library/cgitb.html)27- [20.4. `wsgiref` – Утилиты WSGI и эталонная реализация](https://python-all.ru/2.7/library/wsgiref.html)2829 - [20.4.1. `wsgiref.util` – Утилиты окружения WSGI](https://python-all.ru/2.7/library/wsgiref.html#module-wsgiref.util)30 - [20.4.2. `wsgiref.headers` – Инструменты для заголовков ответов WSGI](https://python-all.ru/2.7/library/wsgiref.html#module-wsgiref.headers)31 - [20.4.3. `wsgiref.simple_server` – Простой HTTP-сервер WSGI](https://python-all.ru/2.7/library/wsgiref.html#module-wsgiref.simple_server)32 - [20.4.4. `wsgiref.validate` – Проверка соответствия WSGI](https://python-all.ru/2.7/library/wsgiref.html#module-wsgiref.validate)33 - [20.4.5. `wsgiref.handlers` – Базовые классы сервера/шлюза](https://python-all.ru/2.7/library/wsgiref.html#module-wsgiref.handlers)34 - [20.4.6. Примеры](https://python-all.ru/2.7/library/wsgiref.html#examples)35- [20.5. `urllib` – Открытие произвольных ресурсов по URL](https://python-all.ru/2.7/library/urllib.html)3637 - [20.5.1. Интерфейс высокого уровня](https://python-all.ru/2.7/library/urllib.html#high-level-interface)38 - [20.5.2. Вспомогательные функции](https://python-all.ru/2.7/library/urllib.html#utility-functions)39 - [20.5.3. Объекты-открыватели URL](https://python-all.ru/2.7/library/urllib.html#url-opener-objects)40 - [20.5.4. `urllib` Ограничения](https://python-all.ru/2.7/library/urllib.html#urllib-restrictions)41 - [20.5.5. Примеры](https://python-all.ru/2.7/library/urllib.html#examples)42- [20.6. `urllib2` – Расширяемая библиотека для открытия URL](https://python-all.ru/2.7/library/urllib2.html)4344 - [20.6.1. Объекты запроса](https://python-all.ru/2.7/library/urllib2.html#request-objects)45 - [20.6.2. Объекты OpenerDirector](https://python-all.ru/2.7/library/urllib2.html#openerdirector-objects)46 - [20.6.3. Объекты BaseHandler](https://python-all.ru/2.7/library/urllib2.html#basehandler-objects)47 - [20.6.4. Объекты HTTPRedirectHandler](https://python-all.ru/2.7/library/urllib2.html#httpredirecthandler-objects)48 - [20.6.5. Объекты HTTPCookieProcessor](https://python-all.ru/2.7/library/urllib2.html#httpcookieprocessor-objects)49 - [20.6.6. Объекты ProxyHandler](https://python-all.ru/2.7/library/urllib2.html#proxyhandler-objects)50 - [20.6.7. Объекты HTTPPasswordMgr](https://python-all.ru/2.7/library/urllib2.html#httppasswordmgr-objects)51 - [20.6.8. Объекты AbstractBasicAuthHandler](https://python-all.ru/2.7/library/urllib2.html#abstractbasicauthhandler-objects)52 - [20.6.9. Объекты HTTPBasicAuthHandler](https://python-all.ru/2.7/library/urllib2.html#httpbasicauthhandler-objects)53 - [20.6.10. Объекты ProxyBasicAuthHandler](https://python-all.ru/2.7/library/urllib2.html#proxybasicauthhandler-objects)54 - [20.6.11. Объекты AbstractDigestAuthHandler](https://python-all.ru/2.7/library/urllib2.html#abstractdigestauthhandler-objects)55 - [20.6.12. Объекты HTTPDigestAuthHandler](https://python-all.ru/2.7/library/urllib2.html#httpdigestauthhandler-objects)56 - [20.6.13. Объекты ProxyDigestAuthHandler](https://python-all.ru/2.7/library/urllib2.html#proxydigestauthhandler-objects)57 - [20.6.14. Объекты HTTPHandler](https://python-all.ru/2.7/library/urllib2.html#httphandler-objects)58 - [20.6.15. Объекты HTTPSHandler](https://python-all.ru/2.7/library/urllib2.html#httpshandler-objects)59 - [20.6.16. Объекты FileHandler](https://python-all.ru/2.7/library/urllib2.html#filehandler-objects)60 - [20.6.17. Объекты FTPHandler](https://python-all.ru/2.7/library/urllib2.html#ftphandler-objects)61 - [20.6.18. Объекты CacheFTPHandler](https://python-all.ru/2.7/library/urllib2.html#cacheftphandler-objects)62 - [20.6.19. Объекты UnknownHandler](https://python-all.ru/2.7/library/urllib2.html#unknownhandler-objects)63 - [20.6.20. Объекты HTTPErrorProcessor](https://python-all.ru/2.7/library/urllib2.html#httperrorprocessor-objects)64 - [20.6.21. Примеры](https://python-all.ru/2.7/library/urllib2.html#examples)65- [20.7. `httplib` – Клиент протокола HTTP](https://python-all.ru/2.7/library/httplib.html)6667 - [20.7.1. Объекты HTTPConnection](https://python-all.ru/2.7/library/httplib.html#httpconnection-objects)68 - [20.7.2. Объекты HTTPResponse](https://python-all.ru/2.7/library/httplib.html#httpresponse-objects)69 - [20.7.3. Примеры](https://python-all.ru/2.7/library/httplib.html#examples)70- [20.8. `ftplib` – Клиент протокола FTP](https://python-all.ru/2.7/library/ftplib.html)7172 - [20.8.1. Объекты FTP](https://python-all.ru/2.7/library/ftplib.html#ftp-objects)73 - [20.8.2. Объекты FTP\_TLS](https://python-all.ru/2.7/library/ftplib.html#ftp-tls-objects)74- [20.9. `poplib` – Клиент протокола POP3](https://python-all.ru/2.7/library/poplib.html)7576 - [20.9.1. Объекты POP3](https://python-all.ru/2.7/library/poplib.html#pop3-objects)77 - [20.9.2. Пример POP3](https://python-all.ru/2.7/library/poplib.html#pop3-example)78- [20.10. `imaplib` – Клиент протокола IMAP4](https://python-all.ru/2.7/library/imaplib.html)7980 - [20.10.1. Объекты IMAP4](https://python-all.ru/2.7/library/imaplib.html#imap4-objects)81 - [20.10.2. Пример IMAP4](https://python-all.ru/2.7/library/imaplib.html#imap4-example)82- [20.11. `nntplib` – Клиент протокола NNTP](https://python-all.ru/2.7/library/nntplib.html)8384 - [20.11.1. Объекты NNTP](https://python-all.ru/2.7/library/nntplib.html#nntp-objects)85- [20.12. `smtplib` – Клиент протокола SMTP](https://python-all.ru/2.7/library/smtplib.html)8687 - [20.12.1. Объекты SMTP](https://python-all.ru/2.7/library/smtplib.html#smtp-objects)88 - [20.12.2. Пример SMTP](https://python-all.ru/2.7/library/smtplib.html#smtp-example)89- [20.13. `smtpd` – Сервер SMTP](https://python-all.ru/2.7/library/smtpd.html)9091 - [20.13.1. Объекты SMTPServer](https://python-all.ru/2.7/library/smtpd.html#smtpserver-objects)92 - [20.13.2. Объекты DebuggingServer](https://python-all.ru/2.7/library/smtpd.html#debuggingserver-objects)93 - [20.13.3. Объекты PureProxy](https://python-all.ru/2.7/library/smtpd.html#pureproxy-objects)94 - [20.13.4. Объекты MailmanProxy](https://python-all.ru/2.7/library/smtpd.html#mailmanproxy-objects)95- [20.14. `telnetlib` – Telnet-клиент](https://python-all.ru/2.7/library/telnetlib.html)9697 - [20.14.1. Объекты Telnet](https://python-all.ru/2.7/library/telnetlib.html#telnet-objects)98 - [20.14.2. Пример Telnet](https://python-all.ru/2.7/library/telnetlib.html#telnet-example)99- [20.15. `uuid` – объекты UUID в соответствии с RFC 4122](https://python-all.ru/2.7/library/uuid.html)100101 - [20.15.1. Пример](https://python-all.ru/2.7/library/uuid.html#example)102- [20.16. `urlparse` – разбор URL на компоненты](https://python-all.ru/2.7/library/urlparse.html)103104 - [20.16.1. Результаты `urlparse()` и `urlsplit()`](https://python-all.ru/2.7/library/urlparse.html#results-of-urlparse-and-urlsplit)105- [20.17. `SocketServer` – каркас для сетевых серверов](https://python-all.ru/2.7/library/socketserver.html)106107 - [20.17.1. Примечания по созданию сервера](https://python-all.ru/2.7/library/socketserver.html#server-creation-notes)108 - [20.17.2. Объекты сервера](https://python-all.ru/2.7/library/socketserver.html#server-objects)109 - [20.17.3. Объекты обработчика запросов](https://python-all.ru/2.7/library/socketserver.html#request-handler-objects)110 - [20.17.4. Примеры](https://python-all.ru/2.7/library/socketserver.html#examples)111112 - [20.17.4.1. `SocketServer.TCPServer` Пример](https://python-all.ru/2.7/library/socketserver.html#socketserver-tcpserver-example)113 - [20.17.4.2. `SocketServer.UDPServer` Пример](https://python-all.ru/2.7/library/socketserver.html#socketserver-udpserver-example)114 - [20.17.4.3. Асинхронные примеси](https://python-all.ru/2.7/library/socketserver.html#asynchronous-mixins)115- [20.18. `BaseHTTPServer` – базовый HTTP-сервер](https://python-all.ru/2.7/library/basehttpserver.html)116117 - [20.18.1. Дополнительные примеры](https://python-all.ru/2.7/library/basehttpserver.html#more-examples)118- [20.19. `SimpleHTTPServer` – простой обработчик HTTP-запросов](https://python-all.ru/2.7/library/simplehttpserver.html)119- [20.20. `CGIHTTPServer` – обработчик HTTP-запросов с поддержкой CGI](https://python-all.ru/2.7/library/cgihttpserver.html)120- [20.21. `cookielib` – управление cookie для HTTP-клиентов](https://python-all.ru/2.7/library/cookielib.html)121122 - [20.21.1. Объекты CookieJar и FileCookieJar](https://python-all.ru/2.7/library/cookielib.html#cookiejar-and-filecookiejar-objects)123 - [20.21.2. Подклассы FileCookieJar и взаимодействие с веб-браузерами](https://python-all.ru/2.7/library/cookielib.html#filecookiejar-subclasses-and-co-operation-with-web-browsers)124 - [20.21.3. Объекты CookiePolicy](https://python-all.ru/2.7/library/cookielib.html#cookiepolicy-objects)125 - [20.21.4. Объекты DefaultCookiePolicy](https://python-all.ru/2.7/library/cookielib.html#defaultcookiepolicy-objects)126 - [20.21.5. Объекты Cookie](https://python-all.ru/2.7/library/cookielib.html#cookie-objects)127 - [20.21.6. Примеры](https://python-all.ru/2.7/library/cookielib.html#examples)128- [20.22. `Cookie` – управление состоянием HTTP](https://python-all.ru/2.7/library/cookie.html)129130 - [20.22.1. Объекты Cookie](https://python-all.ru/2.7/library/cookie.html#cookie-objects)131 - [20.22.2. Объекты Morsel](https://python-all.ru/2.7/library/cookie.html#morsel-objects)132 - [20.22.3. Пример](https://python-all.ru/2.7/library/cookie.html#example)133- [20.23. `xmlrpclib` – клиентский доступ к XML-RPC](https://python-all.ru/2.7/library/xmlrpclib.html)134135 - [20.23.1. Объекты ServerProxy](https://python-all.ru/2.7/library/xmlrpclib.html#serverproxy-objects)136 - [20.23.2. Объекты Boolean](https://python-all.ru/2.7/library/xmlrpclib.html#boolean-objects)137 - [20.23.3. Объекты DateTime](https://python-all.ru/2.7/library/xmlrpclib.html#datetime-objects)138 - [20.23.4. Объекты Binary](https://python-all.ru/2.7/library/xmlrpclib.html#binary-objects)139 - [20.23.5. Объекты Fault](https://python-all.ru/2.7/library/xmlrpclib.html#fault-objects)140 - [20.23.6. Объекты ProtocolError](https://python-all.ru/2.7/library/xmlrpclib.html#protocolerror-objects)141 - [20.23.7. Объекты MultiCall](https://python-all.ru/2.7/library/xmlrpclib.html#multicall-objects)142 - [20.23.8. Вспомогательные функции](https://python-all.ru/2.7/library/xmlrpclib.html#convenience-functions)143 - [20.23.9. Пример использования клиента](https://python-all.ru/2.7/library/xmlrpclib.html#example-of-client-usage)144 - [20.23.10. Пример использования клиента и сервера](https://python-all.ru/2.7/library/xmlrpclib.html#example-of-client-and-server-usage)145- [20.24. `SimpleXMLRPCServer` – Базовый сервер XML-RPC](https://python-all.ru/2.7/library/simplexmlrpcserver.html)146147 - [20.24.1. Объекты SimpleXMLRPCServer](https://python-all.ru/2.7/library/simplexmlrpcserver.html#simplexmlrpcserver-objects)148149 - [20.24.1.1. Пример SimpleXMLRPCServer](https://python-all.ru/2.7/library/simplexmlrpcserver.html#simplexmlrpcserver-example)150 - [20.24.2. CGIXMLRPCRequestHandler](https://python-all.ru/2.7/library/simplexmlrpcserver.html#cgixmlrpcrequesthandler)151- [20.25. `DocXMLRPCServer` – Самодокументирующийся сервер XML-RPC](https://python-all.ru/2.7/library/docxmlrpcserver.html)152153 - [20.25.1. Объекты DocXMLRPCServer](https://python-all.ru/2.7/library/docxmlrpcserver.html#docxmlrpcserver-objects)154 - [20.25.2. DocCGIXMLRPCRequestHandler](https://python-all.ru/2.7/library/docxmlrpcserver.html#doccgixmlrpcrequesthandler)155