2017-06-03 18:40:28 -07:00
|
|
|
[/
|
|
|
|
|
Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
|
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[section:websocket Using WebSocket]
|
|
|
|
|
|
|
|
|
|
[block '''
|
|
|
|
|
<informaltable frame="all"><tgroup cols="1"><colspec colname="a"/><tbody><row><entry valign="top"><simplelist>
|
|
|
|
|
<member><link linkend="beast.websocket.streams">Creating Streams</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.connect">Establishing Connections</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.client">Handshaking (Clients)</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.server">Handshaking (Servers)</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.messages">Send and Receive Messages</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.control">Control Frames</link></member>
|
|
|
|
|
<member><link linkend="beast.websocket.notes">Additional Notes</link></member>
|
|
|
|
|
</simplelist></entry></row></tbody></tgroup></informaltable>
|
|
|
|
|
''']
|
|
|
|
|
|
|
|
|
|
The WebSocket Protocol enables two-way communication between a client
|
|
|
|
|
running untrusted code in a controlled environment to a remote host that has
|
|
|
|
|
opted-in to communications from that code. The protocol consists of an opening
|
|
|
|
|
handshake followed by basic message framing, layered over TCP. The goal of
|
|
|
|
|
this technology is to provide a mechanism for browser-based applications
|
|
|
|
|
needing two-way communication with servers without relying on opening multiple
|
|
|
|
|
HTTP connections.
|
|
|
|
|
|
|
|
|
|
Beast provides developers with a robust WebSocket implementation built on
|
|
|
|
|
Boost.Asio with a consistent asynchronous model using a modern C++ approach.
|
|
|
|
|
|
|
|
|
|
[note
|
|
|
|
|
The WebSocket documentation assumes familiarity the WebSocket protocol
|
|
|
|
|
specification described in __rfc6455__. Code appearing in these
|
|
|
|
|
sections is written as if the following declarations are in effect:
|
|
|
|
|
```
|
|
|
|
|
#include <beast/websocket.hpp>
|
|
|
|
|
```
|
|
|
|
|
]
|
|
|
|
|
|
2017-06-04 07:19:19 -07:00
|
|
|
[include 5_1_streams.qbk]
|
|
|
|
|
[include 5_2_connect.qbk]
|
|
|
|
|
[include 5_3_client.qbk]
|
|
|
|
|
[include 5_4_server.qbk]
|
|
|
|
|
[include 5_5_messages.qbk]
|
|
|
|
|
[include 5_6_control.qbk]
|
|
|
|
|
[include 5_7_notes.qbk]
|
2017-06-03 18:40:28 -07:00
|
|
|
|
|
|
|
|
[endsect]
|