mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge pull request #177 from tekn0ir/fix_libssl_example
Fix linking error on OSX & fix websocket example
This commit is contained in:
commit
6df366ce1d
@ -19,7 +19,13 @@ endif()
|
|||||||
|
|
||||||
add_executable(example_websocket websocket/example_ws.cpp)
|
add_executable(example_websocket websocket/example_ws.cpp)
|
||||||
target_link_libraries(example_websocket ${Boost_LIBRARIES})
|
target_link_libraries(example_websocket ${Boost_LIBRARIES})
|
||||||
target_link_libraries(example_websocket ${CMAKE_THREAD_LIBS_INIT} ssl crypto)
|
target_link_libraries(example_websocket ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
|
||||||
|
add_custom_command(OUTPUT ws.html
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
|
copy ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html ${CMAKE_CURRENT_BINARY_DIR}/ws.html
|
||||||
|
DEPENDS ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html
|
||||||
|
)
|
||||||
|
add_custom_target(example_ws_copy ALL DEPENDS ws.html)
|
||||||
|
|
||||||
add_executable(example example.cpp)
|
add_executable(example example.cpp)
|
||||||
#target_link_libraries(example crow)
|
#target_link_libraries(example crow)
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
</textarea>
|
</textarea>
|
||||||
<script>
|
<script>
|
||||||
var sock = new WebSocket("ws://{{servername}}:40080/ws");
|
var sock = new WebSocket("ws://{{servername}}:40080/ws");
|
||||||
|
|
||||||
sock.onopen = ()=>{
|
sock.onopen = ()=>{
|
||||||
console.log('open')
|
console.log('open')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user