mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Reorganize SSL examples
This commit is contained in:
@ -2,6 +2,7 @@ Version 61:
|
||||
|
||||
* Remove Spirit dependency
|
||||
* Use generic_cateogry for errno
|
||||
* Reorganize SSL examples
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -185,6 +185,7 @@ add_subdirectory (example)
|
||||
if (NOT OPENSSL_FOUND)
|
||||
message("OpenSSL not found. Not building SSL tests and examples")
|
||||
else()
|
||||
add_subdirectory (example/ssl)
|
||||
add_subdirectory (example/ssl-http-client)
|
||||
add_subdirectory (example/ssl-websocket-client)
|
||||
add_subdirectory (test/websocket/ssl)
|
||||
endif()
|
||||
|
@ -57,7 +57,7 @@ as measured by Alexa.
|
||||
This example demonstrates sending and receiving HTTP messages
|
||||
over a TLS connection. Requires OpenSSL to build.
|
||||
|
||||
* [repo_file example/ssl/http_ssl_example.cpp]
|
||||
* [repo_file example/ssl-http-client/ssl_http_client.cpp]
|
||||
|
||||
[endsect]
|
||||
|
||||
@ -68,7 +68,7 @@ over a TLS connection. Requires OpenSSL to build.
|
||||
Establish a WebSocket connection over an encrypted TLS connection,
|
||||
send a message and receive the reply. Requires OpenSSL to build.
|
||||
|
||||
* [repo_file example/ssl/websocket_ssl_example.cpp]
|
||||
* [repo_file example/ssl-websocket-client/ssl_websocket_client.cpp]
|
||||
|
||||
[endsect]
|
||||
|
||||
|
@ -10,3 +10,7 @@ build-project http-client ;
|
||||
build-project http-crawl ;
|
||||
build-project server-framework ;
|
||||
build-project websocket-client ;
|
||||
|
||||
# VFALCO How do I make this work on Windows and if OpenSSL is not available?
|
||||
#build-project ssl-http-client ;
|
||||
#build-project ssl-websocket-client ;
|
||||
|
14
example/ssl-http-client/CMakeLists.txt
Normal file
14
example/ssl-http-client/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# Part of Beast
|
||||
|
||||
GroupSources(include/beast beast)
|
||||
|
||||
GroupSources(example/ssl-http-client "/")
|
||||
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
add_executable (ssl-http-client
|
||||
${BEAST_INCLUDES}
|
||||
ssl_http_client.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ssl-http-client Beast ${OPENSSL_LIBRARIES})
|
@ -43,12 +43,7 @@ project
|
||||
<library>crypto
|
||||
;
|
||||
|
||||
exe http-ssl-example
|
||||
exe ssl-http-client
|
||||
:
|
||||
http_ssl_example.cpp
|
||||
;
|
||||
|
||||
exe websocket-ssl-example
|
||||
:
|
||||
websocket_ssl_example.cpp
|
||||
ssl_http_client.cpp
|
||||
;
|
14
example/ssl-websocket-client/CMakeLists.txt
Normal file
14
example/ssl-websocket-client/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# Part of Beast
|
||||
|
||||
GroupSources(include/beast beast)
|
||||
|
||||
GroupSources(example/ssl-websocket-client "/")
|
||||
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
add_executable (ssl-websocket-client
|
||||
${BEAST_INCLUDES}
|
||||
ssl_websocket_client.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ssl-websocket-client Beast ${OPENSSL_LIBRARIES})
|
49
example/ssl-websocket-client/Jamfile
Normal file
49
example/ssl-websocket-client/Jamfile
Normal file
@ -0,0 +1,49 @@
|
||||
#
|
||||
# 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)
|
||||
#
|
||||
|
||||
import os ;
|
||||
|
||||
if [ os.name ] = SOLARIS
|
||||
{
|
||||
lib socket ;
|
||||
lib nsl ;
|
||||
}
|
||||
else if [ os.name ] = NT
|
||||
{
|
||||
lib ws2_32 ;
|
||||
lib mswsock ;
|
||||
}
|
||||
else if [ os.name ] = HPUX
|
||||
{
|
||||
lib ipv6 ;
|
||||
}
|
||||
else if [ os.name ] = HAIKU
|
||||
{
|
||||
lib network ;
|
||||
}
|
||||
|
||||
if [ os.name ] = NT
|
||||
{
|
||||
lib ssl : : <name>ssleay32 ;
|
||||
lib crypto : : <name>libeay32 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
lib ssl ;
|
||||
lib crypto ;
|
||||
}
|
||||
|
||||
project
|
||||
: requirements
|
||||
<library>ssl
|
||||
<library>crypto
|
||||
;
|
||||
|
||||
exe ssl-websocket-client
|
||||
:
|
||||
ssl_websocket_client.cpp
|
||||
;
|
@ -1,24 +0,0 @@
|
||||
# Part of Beast
|
||||
|
||||
GroupSources(extras/beast extras)
|
||||
GroupSources(include/beast beast)
|
||||
|
||||
GroupSources(example/ssl "/")
|
||||
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
add_executable (http-ssl-example
|
||||
${BEAST_INCLUDES}
|
||||
${EXTRAS_INCLUDES}
|
||||
http_ssl_example.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-ssl-example Beast ${OPENSSL_LIBRARIES})
|
||||
|
||||
add_executable (websocket-ssl-example
|
||||
${BEAST_INCLUDES}
|
||||
${EXTRAS_INCLUDES}
|
||||
websocket_ssl_example.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-ssl-example Beast ${OPENSSL_LIBRARIES})
|
Reference in New Issue
Block a user