Из Википедии, бесплатной энциклопедии
  (Перенаправлено из Push-уведомления )
Перейти к навигации Перейти к поиску

Технология push или server push - это стиль связи через Интернет, при котором запрос на данную транзакцию инициируется издателем или центральным сервером . Это контрастирует с pull / get, где запрос на передачу информации инициируется получателем или клиентом .

Push-сервисы часто основаны на заранее выраженных информационных предпочтениях. Это называется моделью публикации / подписки . Клиент «подписывается» на различные информационные «каналы», предоставляемые сервером; всякий раз, когда новый контент доступен на одном из этих каналов, сервер отправляет эту информацию клиенту.

Push иногда эмулируется с помощью метода опроса , особенно в обстоятельствах, когда реальный push невозможен, например, на сайтах с политиками безопасности, которые требуют отклонения входящих запросов HTTP / S.

Общее использование [ править ]

Синхронная конференц-связь и обмен мгновенными сообщениями являются типичными примерами push-сервисов. Сообщения чата, а иногда и файлы отправляются пользователю сразу после их получения службой обмена сообщениями. Как децентрализованные одноранговые программы (например, WASTE ), так и централизованные программы (например, IRC или XMPP ) позволяют отправлять файлы, что означает, что отправитель инициирует передачу данных, а не получатель.

Электронная почта также может быть системой push: SMTP - это протокол push (см. Push-электронная почта ). Однако последний шаг - от почтового сервера к настольному компьютеру - обычно использует опрашивающий протокол, такой как POP3 или IMAP . Современные почтовые клиенты делают этот шаг мгновенным, постоянно опрашивая почтовый сервер, часто проверяя его на наличие новой почты. Протокол IMAP включает команду IDLE , которая позволяет серверу сообщать клиенту о поступлении новых сообщений. Оригинальный BlackBerry был первым популярным примером push-электронной почты в беспроводном контексте. [ необходима цитата ]

Другой пример - сеть PointCast , широко известная в 1990-е годы. Он предоставил новости и данные фондового рынка в качестве заставки. И Netscape, и Microsoft интегрировали push-технологию через формат определения канала (CDF) в свое программное обеспечение в разгар войны браузеров , но она никогда не пользовалась большой популярностью. CDF исчез и был удален из браузеров того времени, заменив в 2000-х годах RSS (вытягивающая система).

Другие виды использования веб-приложений с поддержкой push включают распространение обновлений программного обеспечения («push-обновления»), распространение рыночных данных (биржевые тикеры), онлайн-чаты / системы обмена сообщениями ( веб-чат ), аукционы, онлайн-ставки и игры, спортивные результаты, консоли мониторинга и мониторинг сенсорной сети .

Примеры [ править ]

Webpush [ править ]

The Webpush proposal of the Internet Engineering Task Force is a simple protocol using HTTP version 2 to deliver realtime events, such as incoming calls or messages, which can be delivered (or “pushed”) in a timely fashion. The protocol consolidates all real-time events into a single session which ensures more efficient use of network and radio resources. A single service consolidates all events, distributing those events to applications as they arrive. This requires just one session, avoiding duplicated overhead costs.[1]

Веб-уведомления являются частью стандарта W3C и определяют API для уведомлений конечных пользователей. Уведомление позволяет предупреждать пользователя о происшествии вне контекста веб-страницы, например о доставке электронной почты. [2] Как часть этого стандартного Push API, определенного W3C, теперь внедряется в Chrome, Firefox, Edge и Safari. [3]

Нажатие HTTP-сервера [ править ]

Проталкивание HTTP-сервера (также известное как HTTP-поток) - это механизм для отправки незапрашиваемых (асинхронных) данных с веб-сервера в веб-браузер . Проталкивание HTTP-сервера может быть достигнуто с помощью любого из нескольких механизмов.

Являясь частью HTML5, WebSocket API позволяет веб-серверу и клиенту обмениваться данными через полнодуплексное TCP-соединение.

Обычно веб-сервер не разрывает соединение после того, как данные ответа были доставлены клиенту. Веб-сервер оставляет соединение открытым, поэтому в случае возникновения события (например, изменение внутренних данных, о которых необходимо сообщить одному или нескольким клиентам), оно может быть отправлено немедленно; в противном случае событие должно быть поставлено в очередь до тех пор, пока не будет получен следующий запрос клиента. Большинство веб-серверов предлагают эту функциональность через CGI (например, сценарии непарсированных заголовков на HTTP-сервере Apache ). Основным механизмом этого подхода является кодирование передачи по частям .

Another mechanism is related to a special MIME type called multipart/x-mixed-replace, which was introduced by Netscape in 1995. Web browsers interpret this as a document that changes whenever the server pushes a new version to the client.[4] It is still supported by Firefox, Opera, and Safari today, but it is ignored by Internet Explorer[5] and is only partially supported by Google Chrome.[6] It can be applied to HTML documents, and also for streaming images in webcam applications.

The WHATWG Web Applications 1.0 proposal[7] includes a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental system in a feature called "Server-Sent Events".[8][9] It is now being standardized as part of HTML5.[10]

Pushlet[edit]

In this technique, the server takes advantage of persistent HTTP connections, leaving the response perpetually "open" (i.e., the server never terminates the response), effectively fooling the browser to remain in "loading" mode after the initial page load could be considered complete. The server then periodically sends snippets of JavaScript to update the content of the page, thereby achieving push capability. By using this technique, the client doesn't need Java applets or other plug-ins in order to keep an open connection to the server; the client is automatically notified about new events, pushed by the server.[11][12] One serious drawback to this method, however, is the lack of control the server has over the browser timing out; a page refresh is always necessary if a timeout occurs on the browser end.

Long polling[edit]

Long polling is itself not a true push; long polling is a variation of the traditional polling technique, but it allows emulating a push mechanism under circumstances where a real push is not possible, such as sites with security policies that require rejection of incoming HTTP/S Requests.

With long polling, the client requests information from the server exactly as in normal polling, but with the expectation the server may not respond immediately. If the server has no new information for the client when the poll is received, instead of sending an empty response, the server holds the request open and waits for response information to become available. Once it does have new information, the server immediately sends an HTTP/S response to the client, completing the open HTTP/S Request. Upon receipt of the server response, the client often immediately issues another server request. In this way the usual response latency (the time between when the information first becomes available at the next client request) otherwise associated with polling clients is eliminated.[13]

For example, BOSH is a popular, long-lived HTTP technique used as a long-polling alternative to a continuous TCP connection when such a connection is difficult or impossible to employ directly (e.g., in a web browser);[14] it is also an underlying technology in the XMPP, which Apple uses for its iCloud push support. ??

Flash XMLSocket relays[edit]

This technique, used by chat applications, makes use of the XMLSocket object in a single-pixel Adobe Flash movie. Under the control of JavaScript, the client establishes a TCP connection to a unidirectional relay on the server. The relay server does not read anything from this socket; instead it immediately sends the client a unique identifier. Next, the client makes an HTTP request to the web server, including with it this identifier. The web application can then push messages addressed to the client to a local interface of the relay server, which relays them over the Flash socket. The advantage of this approach is that it appreciates the natural read-write asymmetry that is typical of many web applications, including chat, and as a consequence it offers high efficiency. Since it does not accept data on outgoing sockets, the relay server does not need to poll outgoing TCP connections at all, making it possible to hold open tens of thousands of concurrent connections. In this model, the limit to scale is the TCP stack of the underlying server operating system.

Reliable Group Data Delivery (RGDD)[edit]

In services such as Cloud Computing, to increase reliability and availability of data, it is usually pushed (replicated) to several machines. For example, the Hadoop Distributed File System (HDFS) makes 2 extra copies of any object stored. RGDD focuses on efficiently casting an object from one location to many while saving bandwidth by sending minimal number of copies (only one in the best case) of the object over any link across the network. For example, Datacast [15] is a scheme for delivery to many nodes inside datacenters that relies on regular and structured topologies and DCCast [16] is a similar approach for delivery across datacenters.

Push notification[edit]

A push notification is a message that is "pushed" from backend server or application to user interface, e.g. (but not limited to) mobile applications[17] and desktop applications. Push notifications were first introduced by Apple in 2009.[18][dubious ]In 2010 Google released its own service, Google Cloud to Device Messaging. (It has since been replaced by Google Cloud Messaging and then Firebase Cloud Messaging.)[19]November 2015, Microsoft announced that the Windows Notification Service would be expanded to make use of the Universal Windows Platform architecture, allowing for push data to be sent to Windows 10, Windows 10 Mobile, Xbox, as well as other supported platforms using universal API calls and POST requests.[20]

Push notifications are mainly divided into 2 approaches, local notifications and remote notifications.[21] For local notifications, the application schedules the notification with the local device's OS, or, alternatively, sets as a timer in the application itself if it is able to continuously run in the background. When the event's scheduled time is reached, or the event's programmed condition is met, the message is displayed in the application's user interface.

Remote notifications are handled by a remote server. Under this scenario, the client application needs to be registered on the server with a unique key (e.g., a UUID). The server then fires the message against the unique key to deliver the message to the client application via an agreed client/server protocol such as HTTP or XMPP and the client displays the message received. When the push notification arrives, it can transmit short notifications and messages, set badges on application icons, blink or continuously light up the notification LED, or play alert sounds to attract user's attention.[22] Push notifications are usually used by applications to bring information to users' attention. The content of the messages can be classified in the following example categories:

  • Chat messages, e.g.: messages from Facebook messenger sent by other users.[23]
  • Vendor special offers, e.g.: A vendor may want to advertise their social offers to the customers.
  • Event reminder, e.g.: Some application may allow the customer to create reminder or alert for a specific time.
  • Subscribed topics changes, e.g.: Users may want to get updates regarding the weather in their location, or monitor a web page to track changes, for instance.

Real-time push notifications may raise privacy issues since they can be used to bind virtual identities of social network pseudonyms to the real identities of the smartphone owners.[24]

See also[edit]

  • BlazeDS
  • BOSH
  • Channel Definition Format
  • Client–server model
  • Comet
  • File transfer
  • GraniteDS
  • Lightstreamer
  • Notification LED
  • Pull technology
  • Push Access Protocol
  • Push e-mail
  • HTTP/2
  • SQL Server Notification Services
  • Streaming media
  • WebSocket
  • WebSub

References[edit]

  1. ^ M. Thomson, E. Damaggio and B. Raymor (October 22, 2016). "Generic Event Delivery Using HTTP Push". Internet Draft. Internet Engineering Task Force. Retrieved October 28, 2016.
  2. ^ "Web Notifications".
  3. ^ "Web Push API".
  4. ^ CGI Programming on the World Wide Web O'Reilly book explaining how to use Netscape server-push
  5. ^ Server-Push Documents (HTML & XHTML: The Definitive Guide) Archived 2008-04-17 at the Wayback Machine O'Reilly book explaining server-push
  6. ^ Remove support for multipart/x-mixed-replace main resources
  7. ^ "Web Applications 1.0 specification".
  8. ^ "Event Streaming to Web Browsers". 2006-09-01. Retrieved 2007-03-23.
  9. ^ "Opera takes the lead with AJAX support among browsers: More efficient streaming". 2006-09-01. Archived from the original on 2007-03-18. Retrieved 2007-03-23.
  10. ^ Server-Sent Events
  11. ^ Pushlets introduction
  12. ^ Van Den Broecke, Just (1 March 2000). "Pushlets: Send events from servlets to DHTML client browsers". JavaWorld. Retrieved 2020-07-13.
  13. ^ "RFC6202 - Known Issues and Best Practices for the Use of Long Polling and Streaming in Bidirectional HTTP". Retrieved 2016-05-14.
  14. ^ "XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH)". Retrieved 2012-06-26.
  15. ^ C. Guo; et al. (November 1, 2012). "Datacast: A Scalable and Efficient Reliable Group Data Delivery Service For Data Centers". Microsoft Research. ACM. Retrieved Jun 6, 2017.
  16. ^ M. Noormohammadpour; et al. (July 10, 2017). "DCCast: Efficient Point to Multipoint Transfers Across Datacenters". USENIX. Retrieved Jun 6, 2017.
  17. ^ Wohllebe, Atilla. (2020). "Consumer Acceptance of App Push Notifications: Systematic Review on the Influence of Frequency". International Journal of Interactive Mobile Technologies. 14 (13): 36–47. doi:10.3991/ijim.v14i13.14563.
  18. ^ "iPhone push notification service for devs announced". Engadget. Retrieved 2016-10-18.
  19. ^ "Google Cloud Messaging for Android (GCM) Unveiled, to Replace C2DM Framework". InfoQ. Retrieved 2016-10-18.
  20. ^ mijacobs. "Windows Push Notification Services (WNS) overview". docs.microsoft.com. Retrieved 2017-10-20.
  21. ^ "Local and Remote Notifications in Depth". developer.apple.com. Retrieved 2016-10-18.
  22. ^ "Android and iOS Push Notifications – Blog – JatApp". jatapp.com. Retrieved 2017-10-20.
  23. ^ "How do I adjust my mobile push notifications from Facebook? | Facebook Help Center | Facebook". www.facebook.com. Retrieved 2016-10-18.
  24. ^ Loreti, Pierpaolo; Bracciale, Lorenzo; Caponi, Alberto (2018). "Push Attack: Binding Virtual and Real Identities Using Mobile Push Notifications". Future Internet. 10 (2): 13. doi:10.3390/fi10020013.

External links[edit]

  • W3C Push Workshop. A 1997 workshop that discussed push technology and some early examples thereof
  • HTTP Streaming with Ajax A description of HTTP Streaming from the Ajax Patterns website
  • The WebSocket API candidate recommendation
  • HTML5 Server-Sent Events draft specification