You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* upstream/master:
docs: update compatibility table for Socket.IO v4
docs: fix title format (socketio#297)
feat: allow resource path to be set in connection URI (socketio#134)
fix: resolve client_impl::ping LOG call syntax in debug builds
fix: resolvesocketio#254: handle closing sockets upon on_fail events
fix: lower the minimum CMake supported version
feat: implement socketio#45: add support for logging configuration
feat: add support for Socket.IO v3
refactor: use correct Engine.IO protocol revision
refactor: use standard install paths (socketio#58)
ci: migrate to GitHub Actions
chore: update .gitignore with cmake output
refactor: remove Boost dependency (socketio#176)
4. Run `make install`(if makefile generated) or open generated project (if project file generated) to build.
8
-
5. Outputs is under `./build`, link with the all static libs under `./build/lib` and include headers under `./build/include` in your client code where you want to use it.
9
-
10
-
* If you're using boost without install,you can specify `boost include dir` and `boost lib dir` separately by:
11
-
```bash
12
-
cmake
13
-
-DBOOST_INCLUDEDIR=<your boost include folder>
14
-
-DBOOST_LIBRARYDIR=<your boost lib folder>
15
-
-DBOOST_VER:STRING=<your boost version>
16
-
./
17
-
```
18
-
* CMake didn't allow merging static libraries,but they're all copied to `./build/lib`, you can DIY if you like.
4
+
1. Use `git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git` to clone your local repo.
5
+
2. Run `cmake ./`
6
+
3. Run `make install`(if makefile generated) or open generated project (if project file generated) to build.
7
+
4. Outputs is under `./build`, link with the all static libs under `./build/lib` and include headers under `./build/include` in your client code where you want to use it.
19
8
20
9
### Without CMake
21
-
1. Install boost, see [Boost setup](#boost_setup) section.
22
-
2. Use `git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git` to clone your local repo.
23
-
3. Add `<your boost install folder>/include`,`./lib/websocketpp` and `./lib/rapidjson/include` to headers search path.
24
-
4. Include all files under `./src` in your project, add `sio_client.cpp`,`sio_socket.cpp`,`internal/sio_client_impl.cpp`, `internal/sio_packet.cpp` to source list.
25
-
5. Add `<your boost install folder>/lib` to library search path, add `boost.lib`(Win32) or `-lboost`(Other) link option.
26
-
6. Include `sio_client.h` in your client code where you want to use it.
27
-
28
-
## Boost setup
29
-
30
-
1. Download boost from [boost.org](http://www.boost.org/).
31
-
1. Unpack boost to some place.
32
-
1. Run either .\bootstrap.bat (on Windows), or ./bootstrap.sh (on other operating systems) under boost folder.
33
-
34
-
## Boost build (Build the necessary subset only)
35
-
Windows (or other mainstream desktop platforms shall work too):
36
-
37
-
The following script will build the necessary subset:
Optionally You can merge all output .lib files into a fat one, especially if you're not using cmake.
43
-
44
-
In output folder, run:
45
-
46
-
```bash
47
-
lib.exe /OUT:boost.lib *
48
-
```
10
+
1. Use `git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git` to clone your local repo.
11
+
2. Add `./lib/asio/asio/include`, `./lib/websocketpp` and `./lib/rapidjson/include` to headers search path.
12
+
3. Include all files under `./src` in your project, add `sio_client.cpp`,`sio_socket.cpp`,`internal/sio_client_impl.cpp`, `internal/sio_packet.cpp` to source list.
13
+
4. Include `sio_client.h` in your client code where you want to use it.
By virtue of being written in C++, this client works in several different platforms. The [examples](https://github.com/socketio/socket.io-client-cpp/tree/master/examples) folder contains an iPhone, QT and Console example chat client! It depends on [websocket++](https://github.com/zaphoyd/websocketpp) and is inspired by [socket.io-clientpp](https://github.com/ebshimizu/socket.io-clientpp).
5
6
6
7
[](https://github.com/socketio/socket.io-client-cpp/tree/master/examples)
7
8
9
+
## Compatibility table
10
+
11
+
<table>
12
+
<tr>
13
+
<th rowspan="2">C++ Client version</th>
14
+
<th colspan="2">Socket.IO server version</th>
15
+
</tr>
16
+
<tr>
17
+
<td align="center">1.x / 2.x</td>
18
+
<td align="center">3.x / 4.x</td>
19
+
</tr>
20
+
<tr>
21
+
<td>2.x (<code>2.x</code> branch)</td>
22
+
<td align="center">YES</td>
23
+
<td align="center">YES, with <code><a href="https://socket.io/docs/v4/server-initialization/#allowEIO3">allowEIO3: true</a></code></td>
24
+
</tr>
25
+
<tr>
26
+
<td>3.x (<code>master</code> branch)</td>
27
+
<td align="center">NO</td>
28
+
<td align="center">YES</td>
29
+
</tr>
30
+
</table>
31
+
8
32
## Features
9
33
10
34
- 100% written in modern C++11
11
-
- Compatible with socket.io 1.0+ protocol
12
35
- Binary support
13
36
- Automatic JSON encoding
14
37
- Multiplex support
15
38
- Similar API to the Socket.IO JS client
16
39
- Cross platform
17
40
41
+
Note: Only the WebSocket transport is currently implemented (no fallback to HTTP long-polling)
0 commit comments