Files
boost_beast/doc/2_examples.qbk
T
2017-07-20 08:12:19 -07:00

93 lines
2.5 KiB
Plaintext

[/
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:example Example Programs]
These complete programs are intended to quickly impress upon readers the
flavor of the library. Source code and build scripts for them are located
in the examples directory.
[heading HTTP GET]
Use HTTP to make a GET request to a website and print the response:
File: [repo_file examples/http_example.cpp]
[http_example_get]
[heading WebSocket]
Establish a WebSocket connection, send a message and receive the reply:
File: [repo_file examples/websocket_example.cpp]
[websocket_example_client_echo]
[heading WebSocket Echo Server]
This example demonstrates both synchronous and asynchronous
WebSocket server implementations.
* [repo_file examples/websocket_async_echo_server.hpp]
* [repo_file examples/websocket_sync_echo_server.hpp]
* [repo_file examples/websocket_echo.cpp]
[heading Secure WebSocket]
Establish a WebSocket connection over an encrypted TLS connection,
send a message and receive the reply. Requires OpenSSL to build.
* [repo_file examples/ssl/websocket_ssl_example.cpp]
[heading HTTPS GET]
This example demonstrates sending and receiving HTTP messages
over a TLS connection. Requires OpenSSL to build.
* [repo_file examples/ssl/http_ssl_example.cpp]
[heading HTTP Crawl]
This example retrieves the page at each of the most popular domains
as measured by Alexa.
* [repo_file examples/http_crawl.cpp]
[heading HTTP Server]
This example demonstrates both synchronous and asynchronous server
implementations. It also provides an example of implementing a [*Body]
type, in `file_body`.
* [repo_file examples/file_body.hpp]
* [repo_file examples/http_async_server.hpp]
* [repo_file examples/http_sync_server.hpp]
* [repo_file examples/http_server.cpp]
[heading Composed Operations]
This program shows how to use Beast's core foundations to build a
composable asynchronous initiation function with associated composed
operation implementation. This is a complete, runnable version of
the example described in the Core Foundations document section.
* [repo_file examples/echo_op.cpp]
[heading Documentation Samples]
Here are all of the example functions and classes presented
throughout the documentation, they can be included and used
in your program without modification
* [repo_file examples/doc_core_samples.hpp]
* [repo_file examples/doc_http_samples.hpp]
[endsect]