Skip to content

Merge with master #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 52 commits into
base: eris-sio_tls_support_non_tls_uris
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7a6770e
Change client_impl::send_impl() not to delay ping
Nov 16, 2016
29468bf
Consider all client-initiated closes to be close_reason_normal.
joelnordell Dec 8, 2016
ffff941
URL encode query string.
jianjunz Jan 3, 2017
aee175e
Remove unused parameters and reorder constructors to get rid of warnings
limitedAtonement Feb 13, 2017
4d83a7a
Merge pull request #125 from botlink/master
melode11 Feb 24, 2017
d8f8ed5
Remove unused argument
evileye2000 Mar 6, 2017
ff3297b
Merge pull request #135 from ErisExchange/eris-more_reliable_close
melode11 Oct 14, 2017
d38c233
Merge pull request #149 from evileye2000/master
melode11 Oct 14, 2017
08e83ea
Merge pull request #145 from limitedAtonement/master
melode11 Oct 14, 2017
6063cb1
Merge pull request #138 from jianjunz/querystring
melode11 Oct 14, 2017
af68bf3
refactor: remove Boost dependency (#176)
3p3r Sep 10, 2017
019742f
chore: update .gitignore with cmake output
darrachequesne Jan 7, 2021
8d4fe20
ci: migrate to GitHub Actions
darrachequesne Jan 7, 2021
d353647
refactor: use standard install paths (#58)
Sep 21, 2015
b1216ee
refactor: use correct Engine.IO protocol revision
darrachequesne Jan 9, 2021
ec4d540
feat: add support for Socket.IO v3
darrachequesne Jan 9, 2021
1b42ce7
feat: implement #45: add support for logging configuration
AdrianDC Apr 23, 2020
b196fa7
fix: lower the minimum CMake supported version
dkmoon Feb 27, 2017
d1c73b7
fix: resolve #254: handle closing sockets upon on_fail events
AdrianDC Feb 5, 2021
e7de4eb
fix: resolve client_impl::ping LOG call syntax in debug builds
AdrianDC Feb 5, 2021
36a8cd4
feat: allow resource path to be set in connection URI (#134)
joelnordell Feb 14, 2021
e7f17c6
docs: fix title format (#297)
shardros Mar 24, 2021
0581aab
docs: update compatibility table for Socket.IO v4
darrachequesne Mar 24, 2021
e8ea707
feat: use TLSv2 when TLS is used (#310)
taste1981 Jun 11, 2021
3ff5fc8
update non-cmake installation guide
Desp4 Jul 31, 2021
82d39a9
feat: support TLSv1.2 and newer (#321)
grahn Sep 2, 2021
aba189c
chore(release): 3.1.0
darrachequesne Oct 12, 2021
2573a12
docs: add changelog for version 2.1.0
darrachequesne Oct 12, 2021
94a59f0
Update CMakeLists.txt
Jikari Nov 12, 2021
2b1dda7
chore: increase minimum CMake version (#328)
jmigual Sep 29, 2021
23f243f
feat: send auth object upon connecting (#335)
gabrieljablonski Nov 23, 2021
46597e3
docs: add vcpkg installation instructions (#252)
gabrieljablonski Nov 23, 2021
d823428
Merge pull request #334 from Jikari/patch-1
jmigual Feb 25, 2022
c7e4103
Merge branch 'master' into master
jmigual Feb 25, 2022
e2ca1f1
Merge pull request #319 from Desp4/master
jmigual Feb 25, 2022
9173946
chore: Remove unnecessary check for CMAKE_BUILD_TYPE (#311)
studiofuga Mar 8, 2022
9ad2383
chore: set default build type as Release
jmigual Mar 8, 2022
7496162
deps: bump ws from 7.4.2 to 7.4.6 in /test/echo_server (#308)
dependabot[bot] Mar 9, 2022
c733c3e
docs: remove Cocoapods from iOS installation guide. (#78)
jianjunz Mar 9, 2022
5a0c1ec
core: re-enable ping timeout behaviour for 3x branch (#351)
TorMFinn Mar 9, 2022
bacd917
core: abort retrying when closing down. (#312)
pattivacek Mar 29, 2022
9bca702
build: removing .DS_Store (#362)
abranhe Apr 26, 2022
973baa3
build: Support vcpkg - Update cmake for system install (#367)
geiseri Aug 1, 2022
dbb4547
build: fix installation and change build default flags (#372)
jmigual Aug 4, 2022
201d99d
feat: basic auth proxy (#369)
zeze-zeze Sep 30, 2022
3e01111
build(deps): bump socket.io-parser in /test/echo_server (#377)
dependabot[bot] Nov 14, 2022
b10474e
docs: Remove Boost from Qt example (#387)
jmigual Feb 13, 2023
9066882
feat: allow for custom io_service (#390) (#391)
mscofield0 Jun 26, 2023
9d55f6e
build(deps): update catch2 from 1.10.0 to v3.3.2 (#400)
jmigual Jun 26, 2023
75e0589
feat: allow disabling the logging of the library (#399)
jmigual Jun 26, 2023
2cb116f
Merge branch 'master' into eris-sio_tls_support_non_tls_uris
jmigual Jun 30, 2023
4ecddef
Fix compiler issue with MSVC
jmigual Jun 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/[email protected]

- name: Build project
uses: nicledomaS/[email protected]
with:
submodule_update: ON
run_tests: ON
unit_test_build: -DBUILD_UNIT_TESTS=ON
cmake_args: -DCMAKE_CXX_FLAGS=-std=c++11
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
build/
**/*.user
**/*.user

CMakeCache.txt
CMakeFiles/
Makefile
cmake_install.cmake
install_manifest.txt
libsioclient.a
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/rapidjson"]
path = lib/rapidjson
url = https://github.com/miloyip/rapidjson.git
[submodule "lib/asio"]
path = lib/asio
url = https://github.com/chriskohlhoff/asio.git
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,19 @@ Set listener for reconnecting is in process.

Set listener for reconnecting event, called once a delayed connecting is scheduled.

#### Logs
`void set_logs_default()`

Configure logs to the default level (connect, disconnect, app)

`void set_logs_quiet()`

Configure logs to the quiet level

`void set_logs_verbose()`

Configure logs to the verbose level

#### Namespace
`socket::ptr socket(std::string const& nsp)`

Expand Down
21 changes: 0 additions & 21 deletions BOOST.md

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# [2.1.0](https://github.com/socketio/socket.io-client-cpp/compare/2.0.0...2.1.0) (2021-10-12)


### Bug Fixes

* fix ASIO_STANDALONE release build trying to use boost::random ([#301](https://github.com/socketio/socket.io-client-cpp/issues/301)) ([168ce9d](https://github.com/socketio/socket.io-client-cpp/commit/168ce9d10b4ac667c43fe16b4cf530f6a3749235))
* fix LOG call syntax ([#301](https://github.com/socketio/socket.io-client-cpp/issues/301)) ([c09221f](https://github.com/socketio/socket.io-client-cpp/commit/c09221f357effe1a5a0fc0e7d7902eba1ab0484d))


### Features

* support TLSv1.2 and newer ([#321](https://github.com/socketio/socket.io-client-cpp/issues/321)) ([7c60ba9](https://github.com/socketio/socket.io-client-cpp/commit/7c60ba9d1e5e58de57f127025bcf69f4baecd2b4))



# [3.1.0](https://github.com/socketio/socket.io-client-cpp/compare/3.0.0...3.1.0) (2021-10-12)


### Bug Fixes

* lower the minimum CMake supported version ([b196fa7](https://github.com/socketio/socket.io-client-cpp/commit/b196fa7537cd3f7bed626ead873a7b71d1293c0d))
* handle closing sockets upon on_fail events ([d1c73b7](https://github.com/socketio/socket.io-client-cpp/commit/d1c73b73a8f536da3d353eac2a560af9791b13e3))
* resolve client_impl::ping LOG call syntax in debug builds ([e7de4eb](https://github.com/socketio/socket.io-client-cpp/commit/e7de4ebf64f4f49e18594a2c093c07beb963579a))


### Features

* allow resource path to be set in connection URI ([#134](https://github.com/socketio/socket.io-client-cpp/issues/134)) ([36a8cd4](https://github.com/socketio/socket.io-client-cpp/commit/36a8cd45272aa51f0f6ef27aa4744dbc6e8421f7))
* add support for logging configuration ([1b42ce7](https://github.com/socketio/socket.io-client-cpp/commit/1b42ce738f4c3e260f79bcb143bfe6efcdce5709))
* support TLSv1.2 and newer ([#321](https://github.com/socketio/socket.io-client-cpp/issues/321)) ([82d39a9](https://github.com/socketio/socket.io-client-cpp/commit/82d39a90ef118500a0329d214eec331db983bd74))



# [3.0.0](https://github.com/socketio/socket.io-client-cpp/compare/2.0.0...3.0.0) (2021-01-09)


### Features

* add support for Socket.IO v3 ([ec4d540](https://github.com/socketio/socket.io-client-cpp/commit/ec4d540ad54593604ac2091e67ffc2a6d9a00db6))

211 changes: 154 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,84 +1,181 @@
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
PROJECT(sioclient)
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)

PROJECT(sioclient
VERSION 3.1.0
)

option(BUILD_SHARED_LIBS "Build the shared library" OFF)
option(Boost_USE_STATIC_LIBS "Use Boost static version" ON)

set(MAJOR 1)
set(MINOR 6)
set(PATCH 0)

if(NOT CMAKE_BUILD_TYPE )
MESSAGE(STATUS "not define build type, set to release" )
set(CMAKE_BUILD_TYPE Release )
elseif(NOT (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ))
MESSAGE(SEND_ERROR "CMAKE_BUILD_TYPE must be either Release or Debug")
return()
option(BUILD_UNIT_TESTS "Builds unit tests target" OFF)
option(USE_SUBMODULES "Use source in local submodules instead of system libraries" ON)
option(DISABLE_LOGGING "Do not print logging messages" OFF)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(DEFAULT_BUILD_TYPE "Release")
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

set(BOOST_VER "1.55.0" CACHE STRING "boost version" )
# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Testing only available if this is the main app
# Note this needs to be done in the main CMakeLists
# since it calls enable_testing, which must be in the
# main CMakeLists.
include(CTest)
endif()

set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost ${BOOST_VER} REQUIRED COMPONENTS system date_time random)
add_definitions(
# These will force ASIO to compile without Boost
-DBOOST_DATE_TIME_NO_LIB
-DBOOST_REGEX_NO_LIB
-DASIO_STANDALONE

# These will force sioclient to compile with C++11
-D_WEBSOCKETPP_CPP11_STL_
-D_WEBSOCKETPP_CPP11_FUNCTIONAL_
-D_WEBSOCKETPP_CPP11_TYPE_TRAITS_
-D_WEBSOCKETPP_CPP11_CHRONO_
)

if (MSVC)
# To solve error C1128: number of sections exceeded object file format limit: compile with /bigobj
add_compile_options(/bigobj)
endif()

aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src ALL_SRC)
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/internal ALL_SRC)
file(GLOB ALL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/*.h )
set(SIO_INCLUDEDIR ${CMAKE_CURRENT_LIST_DIR})
if (DISABLE_LOGGING)
add_definitions(-DSIO_DISABLE_LOGGING)
endif()

set(ALL_SRC
"src/sio_client.cpp"
"src/sio_socket.cpp"
"src/internal/sio_client_impl.cpp"
"src/internal/sio_packet.cpp"
)
add_library(sioclient ${ALL_SRC})
target_include_directories(sioclient PRIVATE ${Boost_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp
${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include

if(USE_SUBMODULES)
set(MODULE_INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp
${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include
${CMAKE_CURRENT_LIST_DIR}/lib/asio/asio/include
)
else()
find_package(websocketpp CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
target_link_libraries(sioclient PRIVATE websocketpp::websocketpp asio asio::asio rapidjson)
endif()

target_include_directories(sioclient
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${MODULE_INCLUDE_DIRS}
)

set_property(TARGET sioclient PROPERTY CXX_STANDARD 11)
set_property(TARGET sioclient PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(sioclient PRIVATE ${Boost_LIBRARIES})

if(BUILD_SHARED_LIBS)
set_target_properties(sioclient
PROPERTIES
SOVERSION ${MAJOR}
VERSION ${MAJOR}.${MINOR}.${PATCH}
)
set_target_properties(sioclient
PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
)
endif()

list(APPEND TARGET_LIBRARIES sioclient)

find_package(OpenSSL)

if(OPENSSL_FOUND)
add_library(sioclient_tls ${ALL_SRC})
target_include_directories(sioclient_tls PRIVATE ${Boost_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp
${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include
${OPENSSL_INCLUDE_DIR}
)
add_library(sioclient_tls ${ALL_SRC})
target_include_directories(sioclient_tls PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${MODULE_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
)

set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD 11)
set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(sioclient_tls PRIVATE ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} )
target_compile_definitions(sioclient_tls PRIVATE -DSIO_TLS)
if(BUILD_SHARED_LIBS)
set_target_properties(sioclient_tls
PROPERTIES
SOVERSION ${MAJOR}
VERSION ${MAJOR}.${MINOR}.${PATCH}
)
endif()
list(APPEND TARGET_LIBRARIES sioclient_tls)
set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD 11)
set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD_REQUIRED ON)

target_link_libraries(sioclient_tls PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (NOT USE_SUBMODULES)
target_link_libraries(sioclient_tls PRIVATE websocketpp::websocketpp asio asio::asio rapidjson)
endif()

target_compile_definitions(sioclient_tls PRIVATE -DSIO_TLS)

if(BUILD_SHARED_LIBS)
set_target_properties(sioclient_tls
PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
)
endif()

list(APPEND TARGET_LIBRARIES sioclient_tls)
endif()

install(FILES ${ALL_HEADERS}
DESTINATION "${CMAKE_CURRENT_LIST_DIR}/build/include"
export(PACKAGE sioclient)

include(GNUInstallDirs)

file(GLOB ALL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/*.h)
install(FILES ${ALL_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(TARGETS ${TARGET_LIBRARIES}
DESTINATION "${CMAKE_CURRENT_LIST_DIR}/build/lib/${CMAKE_BUILD_TYPE}"
install(TARGETS ${TARGET_LIBRARIES} EXPORT sioclientTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(FILES ${Boost_LIBRARIES}
DESTINATION "${CMAKE_CURRENT_LIST_DIR}/build/lib/${CMAKE_BUILD_TYPE}"
# === generate a CMake Config File ===
include(CMakePackageConfigHelpers)
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/sioclient)
string(REGEX REPLACE "([^;]+)" "find_dependency(\\1)" _find_dependency_calls "${_package_dependencies}")
string(REPLACE ";" "\n" _find_dependency_calls "${_find_dependency_calls}")

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientConfigVersion.cmake"
VERSION ${sioclient_VERSION}
COMPATIBILITY AnyNewerVersion
)

export(EXPORT sioclientTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientTargets.cmake"
NAMESPACE sioclient::
)

configure_package_config_file(sioclientConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientConfig.cmake"
INSTALL_DESTINATION "${ConfigPackageLocation}"
)

install(EXPORT sioclientTargets
NAMESPACE
sioclient::
DESTINATION
${ConfigPackageLocation}
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/sioclient/sioclientTargets.cmake"
DESTINATION
${ConfigPackageLocation}
)

if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) OR BUILD_UNIT_TESTS)
add_subdirectory(test)
endif()
Loading