Compare commits
688 Commits
Author | SHA1 | Date | |
---|---|---|---|
92db53c470 | |||
49865fed0a | |||
f3f71314d9 | |||
2d593dd63b | |||
779b1e6077 | |||
6054dd4b49 | |||
69aa3839bf | |||
6808a0b500 | |||
a7df6120d5 | |||
d20ab19fa9 | |||
b946cda65e | |||
2cfadd93b5 | |||
8607dc1a4a | |||
521286ae88 | |||
d122e12a1f | |||
c26c3b6892 | |||
ed75d14c86 | |||
0841fcec44 | |||
4e717abdb8 | |||
451d2b4253 | |||
10b4ee353d | |||
07822625b7 | |||
c943e72c7b | |||
ebb31b4e87 | |||
6904dd3f4c | |||
0e73fe51e9 | |||
7e67598360 | |||
91a95dc5f6 | |||
c40033b6d9 | |||
adf83f3255 | |||
8fda7cb131 | |||
0e9cf863cf | |||
279f6fbfed | |||
f8e7b34bf0 | |||
d2cf616737 | |||
11a3b64657 | |||
bab2295fc3 | |||
adcbf0d208 | |||
19150115bb | |||
d93bd9b58b | |||
13801dff8a | |||
de87fa34dc | |||
d60f5de231 | |||
22b4e6a8fb | |||
1ed39677ce | |||
562d7484e4 | |||
58d6e4bb26 | |||
0539d2df2e | |||
e023dd9c36 | |||
a95cf727b1 | |||
b96a65031e | |||
2a838d01a7 | |||
b0afd36cec | |||
77863c0e8b | |||
2229159bd2 | |||
89d2606b1d | |||
a7a41c51d9 | |||
4de7cb191b | |||
b3784b4c60 | |||
816c53e3a3 | |||
28c4b83ab9 | |||
3a91894d62 | |||
3c8cd6289b | |||
06297ac756 | |||
1b6584ccba | |||
0499a80c55 | |||
f18980d010 | |||
2fb0ebb05b | |||
7495c9ebb8 | |||
b26d463bad | |||
f8a581aa69 | |||
01f3340718 | |||
a9b8b6decd | |||
ea83327261 | |||
39c0fb0072 | |||
733b414b3b | |||
c32067013a | |||
fbf80f4ab1 | |||
8f8385f8f8 | |||
122118196b | |||
6f2fe49a7b | |||
b667c0ad40 | |||
283cf83d47 | |||
ab1b5cd665 | |||
dbf6d00249 | |||
d0963f4af0 | |||
dd01f734c6 | |||
1769199d32 | |||
8821183aea | |||
a7cf151639 | |||
f7a12f52f8 | |||
1be3b8f4b1 | |||
0b844d8361 | |||
57086e28d8 | |||
a55d4cdb76 | |||
40a45717db | |||
e853d9ac60 | |||
4ec0d9b113 | |||
0fde169aa4 | |||
c09015e870 | |||
7bfa6e8478 | |||
983df2d8f9 | |||
6beba16ca7 | |||
48cefe5525 | |||
ae3856c10f | |||
260a94d3b0 | |||
88c6d6c4cb | |||
d5a4931c92 | |||
11f4e90bc6 | |||
2ce65e7a77 | |||
e81c2c3e5c | |||
e40dda7549 | |||
d959d73261 | |||
07b7e37a92 | |||
eb7888347a | |||
d8664f4988 | |||
5e94791b13 | |||
3e3f7171fc | |||
308fda0b37 | |||
66ed7577b1 | |||
cae23c764f | |||
f25b2af6eb | |||
508d372df1 | |||
12c3275c36 | |||
98189c23dc | |||
ec55b4a82a | |||
5d58982f77 | |||
57665ca825 | |||
deaa753657 | |||
7c7c877621 | |||
afa71a6b4b | |||
172cd39702 | |||
82213fd3a5 | |||
a32bf885ba | |||
61eb662e5f | |||
2887370666 | |||
8826d62075 | |||
fae284e2e1 | |||
2408617ed9 | |||
cc10b7f998 | |||
3c97d5f668 | |||
0accf24320 | |||
8ec2ef345c | |||
10dbe2d44d | |||
6b2cdb6b54 | |||
06bc795133 | |||
239a08ff9b | |||
41dd8d2184 | |||
57b4b13b65 | |||
a66b116aad | |||
5c4102c0be | |||
ebb7318895 | |||
b11876096b | |||
d603a74c6f | |||
95d633e71e | |||
217d0650f4 | |||
45d7bb34d7 | |||
2e32319236 | |||
8eb0d0b7c3 | |||
f18f04c0ee | |||
193da820b2 | |||
c6198305d4 | |||
c77d6ae3f5 | |||
c72b2dbd6b | |||
835523f77b | |||
ec8a35b587 | |||
aca18995d1 | |||
f9178f58aa | |||
2477946e68 | |||
7c4d040384 | |||
197cf8ed36 | |||
dd0d7c268f | |||
b2bfccac0a | |||
8b8b352e61 | |||
0403dd354b | |||
b78b453504 | |||
f8fef833b8 | |||
fc4068f2e5 | |||
c300866dcc | |||
18485a74e5 | |||
4dd5950406 | |||
98de54106d | |||
4d64272a1a | |||
0ccece908b | |||
64cd725060 | |||
cc2fa55608 | |||
4fb268585c | |||
3a2495c456 | |||
1d4d058ed0 | |||
15a1347531 | |||
4cbfa71338 | |||
705625af0a | |||
01bc6654cb | |||
eea42bff66 | |||
06b4762c19 | |||
1ee9479009 | |||
73e94ed03a | |||
1883519e82 | |||
6f6c1f85ef | |||
c55ff3cb1b | |||
08006ddd97 | |||
fa4aee6ddc | |||
691502d7ad | |||
43deaba547 | |||
2d02ae0f0c | |||
a8879da4fc | |||
5f4a430845 | |||
b9231be305 | |||
7cb5cc05e4 | |||
750a752ac0 | |||
61e5f52286 | |||
ce0b716f54 | |||
aae8e5ec65 | |||
2723e8466e | |||
f13c610352 | |||
55c65b08bf | |||
a11aa3e0dd | |||
de0bf5ebcd | |||
15369e1ae9 | |||
d4115880b9 | |||
3c80c75e4a | |||
5cb72dce4c | |||
d2747487e3 | |||
12e664fc61 | |||
cbf21b4008 | |||
68c1bf7017 | |||
257c901255 | |||
15d8c663da | |||
d50125c62d | |||
9262880369 | |||
2b111e8352 | |||
a35cbdfb7c | |||
6a41b7389f | |||
a187e69650 | |||
fcacddbd9f | |||
fa84ade6be | |||
17eaa323ed | |||
6177fe7803 | |||
57976cf613 | |||
977e8794ec | |||
c68848eecc | |||
c6dfb14953 | |||
5bad02ccae | |||
2e379cbf2a | |||
0e23584751 | |||
49fd2a9e53 | |||
6264a8b41d | |||
3990d3bcbf | |||
aa3f201ced | |||
83c261977d | |||
6ca28d96bf | |||
c4a5647b62 | |||
720d5593a5 | |||
13fa325134 | |||
773cbb4907 | |||
a696264b48 | |||
b7db5f77fb | |||
b11678e636 | |||
f746070944 | |||
3323a51ab5 | |||
0e59927384 | |||
5c4840f129 | |||
9ac02323ad | |||
cdbed26d1f | |||
23f171f34d | |||
20b625e483 | |||
f1604c6460 | |||
ba0e007c05 | |||
643e1bf20f | |||
24a32a0603 | |||
c5caf32b77 | |||
09956d7500 | |||
d91c896e46 | |||
042e6a22b8 | |||
14ec12d1f0 | |||
288b05a048 | |||
5af3096070 | |||
570fa01c04 | |||
2a69038c4c | |||
0ba127e447 | |||
7714bdf7e0 | |||
4e5e7ae50a | |||
5741b2f6c1 | |||
76172f92e9 | |||
f8b547c028 | |||
7ccd9e1709 | |||
9217b27d40 | |||
819e9025b1 | |||
53ceab9f91 | |||
a7ed4fe5c3 | |||
3190cd322d | |||
dad2b64e15 | |||
e527ab1613 | |||
d7a0bc212d | |||
aecd5e9c94 | |||
e0edca43d5 | |||
ce70d3d728 | |||
d9be40a0de | |||
e469f04c39 | |||
11774e6825 | |||
42bdfb51c3 | |||
fd637bf1e1 | |||
8085e1416c | |||
671c9f805f | |||
ace7a7ccae | |||
9c3bdf1a77 | |||
f5242b3102 | |||
f1272f059a | |||
91595ff4c2 | |||
3755d29a45 | |||
c2b75399ae | |||
a33ecd1338 | |||
a7e29a9f36 | |||
02399dfa5c | |||
aec2941bac | |||
9315eb5289 | |||
5b2b2ea7b0 | |||
d90b634e80 | |||
6dd8cda074 | |||
701be31554 | |||
25eaf730bc | |||
4edb7447df | |||
5f3de60962 | |||
79c17aba49 | |||
80a90496d9 | |||
bbca803840 | |||
160d3869a9 | |||
afd8f64da8 | |||
6d2548b823 | |||
642356d353 | |||
ba0fa36c2a | |||
12f6cd878d | |||
9aacebbbaf | |||
701c3745c2 | |||
a41d08343c | |||
156288b17b | |||
6467f98241 | |||
b24e4334f6 | |||
bf8abcbf4a | |||
bb484414b1 | |||
fc75b13fae | |||
78f59b4207 | |||
7c5567db56 | |||
ed0e23e8a5 | |||
4c4f99606e | |||
a61586c846 | |||
d64d50c978 | |||
a64b7b0c4a | |||
0caeb81327 | |||
edac7a0171 | |||
abfadad2e9 | |||
2dc1547bbd | |||
5eb23c9764 | |||
9f4b2856b0 | |||
b5fc10326e | |||
8d3a47a873 | |||
4df58f3059 | |||
06b8cb8d3b | |||
ff81f5b496 | |||
c89f73006e | |||
c28951f049 | |||
dfaaaca223 | |||
c7f0bf3d64 | |||
234ce4c173 | |||
f60293b2e7 | |||
9441095637 | |||
f82d38f758 | |||
a7f42f35db | |||
cb1d1bfd85 | |||
28c3f2ea26 | |||
7ecaf1f982 | |||
d0a41f3894 | |||
57562b234f | |||
469d127d61 | |||
d6e9b61c8e | |||
8dc132dbd3 | |||
98e2fbca6a | |||
fa7f0fadde | |||
7fb1b65ddd | |||
77c7fdc636 | |||
2732dfd0f1 | |||
2e4c4b72b6 | |||
fc21ad519b | |||
c65cfd3d26 | |||
8955462f73 | |||
205c8c15bd | |||
78198a0147 | |||
d561e1141e | |||
753fc845ac | |||
5dbc00bbfe | |||
14ec8522ef | |||
0c2d1c22bc | |||
1d39a9c9a9 | |||
b588ed0fa1 | |||
d9f7a138b8 | |||
d3e04ff619 | |||
372dd24cc7 | |||
a9422cf34d | |||
c7e52e6fcd | |||
705e0823cb | |||
8e4cf74974 | |||
0a7157655b | |||
58d65926bb | |||
b178ba16af | |||
e4c09284b5 | |||
9367a1feff | |||
d37ed300e2 | |||
3207ce37b6 | |||
d036ad7138 | |||
4fe07579b9 | |||
f563d14134 | |||
f1b3ecc738 | |||
8387f89115 | |||
773f92347f | |||
8ff1339b80 | |||
c85d5da111 | |||
9ab7bc652a | |||
e5c724eb05 | |||
e0300903d9 | |||
1ef38afcf7 | |||
210d19c8a0 | |||
6d24cc44b2 | |||
768e8eb074 | |||
3dd902e1f9 | |||
f85c5002b7 | |||
d48bf9249b | |||
0dfc66f1c7 | |||
4564173b75 | |||
b60e5aaf1f | |||
da67f4cb9a | |||
b041042473 | |||
f83263d6a1 | |||
b0139c2217 | |||
0ba2e2ce96 | |||
4a91ad80c8 | |||
4cc715b13d | |||
0dfd7cd543 | |||
56f164ce2b | |||
65db8c9b00 | |||
4c4137d9f2 | |||
e433e8b5e9 | |||
bb442021cf | |||
91106b7456 | |||
309b5ee1b3 | |||
4eded01841 | |||
e3d0c899d3 | |||
d7595b0dd0 | |||
f0375e59fa | |||
c367435073 | |||
dc812c384e | |||
10b2d10dbd | |||
f96babc6a6 | |||
4e2e14fb22 | |||
bcf2fc1812 | |||
935e6791a3 | |||
fbb7c012a3 | |||
dac18fcabf | |||
d8e83caffc | |||
fbf80b9f50 | |||
c2a9139d41 | |||
6e3dff149a | |||
1bacbe38f4 | |||
2e9c610ac9 | |||
eb063ec60a | |||
37fb14646d | |||
ae543518d3 | |||
c865d64608 | |||
3004422cb6 | |||
0c46a17443 | |||
497373d976 | |||
91198aca0d | |||
b17a5e5f0b | |||
3f0ef59f65 | |||
1e96edc293 | |||
0afb77393b | |||
7614b642bb | |||
bc89580dfe | |||
358ae13a88 | |||
ccf9dcba70 | |||
94604fad61 | |||
5c4cc7c50d | |||
9ed961ec06 | |||
e6bd8cc8c4 | |||
ee25bd0f92 | |||
e77b9176f3 | |||
afe8b966ad | |||
310724c961 | |||
ceba8ae620 | |||
fead661ab7 | |||
9c8c17f577 | |||
a04f83930f | |||
c421d19800 | |||
521f02c90e | |||
c86b6074f2 | |||
d5d1a2c5f4 | |||
2a90e3f478 | |||
1d49ba41ea | |||
e1de1f6682 | |||
47ed5e4d4d | |||
d77f6f5659 | |||
05f0045d5d | |||
c4afb84f6e | |||
b0b2f9b6d2 | |||
ee37feb489 | |||
6b8337596f | |||
250665b92e | |||
86b83c889e | |||
c9c657c07b | |||
4f2babaf54 | |||
1b03bf4555 | |||
977b995af9 | |||
310ab990bd | |||
d6b49b54d4 | |||
f00cf39462 | |||
18550cf1cb | |||
168918f807 | |||
2750df8aa7 | |||
d6597d9f52 | |||
892ea375e3 | |||
03abe77b5f | |||
e46eb8aa49 | |||
2c4862e0f1 | |||
fd69efa45c | |||
e8aa15917f | |||
b3d77f8902 | |||
9c3b0b08ec | |||
fe7d94194c | |||
d6c26d6aa8 | |||
8a74ddcd13 | |||
18e7189a07 | |||
785dd42c84 | |||
0cff5065d9 | |||
e881b82511 | |||
d5551e5d68 | |||
e8583000b8 | |||
d642ef1a89 | |||
2df118022d | |||
95457c8f4c | |||
0a45b7787f | |||
b8c397e180 | |||
90105fa2b3 | |||
24859fef8a | |||
73d7280723 | |||
262de49c3c | |||
3a77e96a05 | |||
505dd6d50f | |||
3f8027b65c | |||
0f2c765f45 | |||
49077f8f44 | |||
6a23b8530f | |||
ae841af91a | |||
44f38849b2 | |||
ee12fbdb5f | |||
316c630830 | |||
1ea5db6110 | |||
986d9a00c0 | |||
7a05a11014 | |||
f09434263c | |||
335f594165 | |||
fa7ef06f4d | |||
3c9ec0aed0 | |||
c665d65cba | |||
5d4e897cc4 | |||
05033714bf | |||
a02bd3f25c | |||
fdbd213fa2 | |||
da64d349c8 | |||
17b01a8c66 | |||
79dd766fab | |||
8375b28747 | |||
e12551f309 | |||
6102f81710 | |||
9f678e5962 | |||
02a704a8c7 | |||
dd2360ed70 | |||
c4ab996470 | |||
6c54b07d92 | |||
7f9bef3b8d | |||
12d1c5d956 | |||
e9a4bd5617 | |||
f34ccbfdb5 | |||
1fa75d7fb2 | |||
39140ef98c | |||
e30ef4a87c | |||
9fc94f0487 | |||
121acdab6f | |||
6deaa03114 | |||
f4f30686c5 | |||
a21aae521f | |||
aed2356fc1 | |||
a478f734f6 | |||
98c579da03 | |||
e80def0cd0 | |||
cc8a9e883e | |||
4d587e35d8 | |||
50f4fd1115 | |||
06d2b68696 | |||
bf6f057777 | |||
b57c1d69f2 | |||
ff265d83f9 | |||
5b1c97b774 | |||
c8c81366f7 | |||
9a37fd56d1 | |||
7ecaff8c5d | |||
e4b0286a25 | |||
7ae6972306 | |||
59cea0372b | |||
78d88a8520 | |||
273af25d57 | |||
46d00360a8 | |||
3f5935a284 | |||
c236ff66e9 | |||
af3df5e519 | |||
d75753ec98 | |||
332bb87231 | |||
8adbcab441 | |||
9bc2e95196 | |||
30a0aa0a0f | |||
8622ea5cb2 | |||
ed3a50d9b5 | |||
df6a17dcc2 | |||
474985e784 | |||
cb904416c3 | |||
3e064ec63e | |||
b004769552 | |||
17270de621 | |||
239b5bc02c | |||
6bfabd5493 | |||
0b90f7df1b | |||
00ca7c8fb0 | |||
a11952fe22 | |||
06b9b2e649 | |||
dcfdcc3e1b | |||
b13fee16c1 | |||
9a7767ecb1 | |||
9b82a33aff | |||
70ef77a5d5 | |||
77903e9d90 | |||
de66a87a7c | |||
5ea2028c22 | |||
58a68ec0be | |||
a39278f7be | |||
f8373dc666 | |||
3febc2431d | |||
0bf736831a | |||
7710bf793f | |||
a6a43bd361 | |||
a39209a895 | |||
24c9e0abc3 | |||
9cc324d78d | |||
8574beceb1 | |||
0349b7f1c7 | |||
ce1ba20db5 | |||
395d823f41 | |||
6884f9f74f | |||
b34eccd749 | |||
50b638f7fd | |||
5bf1b91528 | |||
f77ececc92 | |||
58cccbdcf9 | |||
5710ffba6a | |||
ccd4522b8f | |||
28f29b7385 | |||
a7a422d6ed | |||
43fcf93584 | |||
32f4c8305e | |||
3cf44c8078 | |||
9e899fde2f | |||
ffd4f1d322 | |||
10dd13deb3 | |||
c1ed83a005 | |||
7117c74142 | |||
dd06a3fb25 | |||
45b579447e | |||
bb0b1836cd | |||
d5c8815438 | |||
ac500ed079 | |||
2bc38acbb1 | |||
977feae1d6 | |||
9c872fcc3e | |||
ec1ca3c55e | |||
16805759d3 | |||
88c2e1f6de | |||
1dc9b559e9 | |||
d31ecfc64e | |||
4813a40f2a | |||
ea81470f4a | |||
2a6b1d5f15 |
15
.github/workflows/ccpp.yml
vendored
15
.github/workflows/ccpp.yml
vendored
@ -2,7 +2,6 @@ name: C/C++ CI
|
||||
|
||||
on: [push]
|
||||
|
||||
# fake comment to trigger an action 1
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
@ -17,16 +16,16 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: install redis
|
||||
run: brew install redis
|
||||
|
||||
- name: start redis server
|
||||
run: brew services start redis
|
||||
|
||||
- name: make test
|
||||
run: make test
|
||||
|
||||
# We don't need to have redis running anymore, as we have our fake limited one
|
||||
# - name: install redis
|
||||
# run: brew install redis
|
||||
#
|
||||
# - name: start redis server
|
||||
# run: brew services start redis
|
||||
|
||||
# # Windows does not work yet, I'm stuck at getting CMake to run + finding vcpkg
|
||||
# win:
|
||||
# runs-on: windows-2016
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,7 +1,3 @@
|
||||
build
|
||||
*.pyc
|
||||
venv
|
||||
ixsnake/ixsnake/.certs/
|
||||
site/
|
||||
ws/.certs/
|
||||
ws/.srl
|
||||
|
@ -1,19 +0,0 @@
|
||||
# Find package structure taken from libcurl
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(JSONCPP_INCLUDE_DIRS json/json.h)
|
||||
find_library(JSONCPP_LIBRARY jsoncpp)
|
||||
|
||||
find_package_handle_standard_args(JSONCPP
|
||||
FOUND_VAR
|
||||
JSONCPP_FOUND
|
||||
REQUIRED_VARS
|
||||
JSONCPP_LIBRARY
|
||||
JSONCPP_INCLUDE_DIRS
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find jsoncpp"
|
||||
)
|
||||
|
||||
set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIRS})
|
||||
set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
|
@ -113,24 +113,22 @@ else()
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSelectInterruptEventFd.h)
|
||||
endif()
|
||||
|
||||
option(USE_TLS "Enable TLS support" FALSE)
|
||||
if (WIN32)
|
||||
set(USE_MBED_TLS TRUE)
|
||||
endif()
|
||||
|
||||
if (USE_TLS)
|
||||
if (WIN32)
|
||||
option(USE_MBED_TLS "Use Mbed TLS" ON)
|
||||
else()
|
||||
option(USE_MBED_TLS "Use Mbed TLS" OFF)
|
||||
endif()
|
||||
option(USE_OPEN_SSL "Use OpenSSL" OFF)
|
||||
|
||||
if (USE_MBED_TLS)
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketMbedTLS.h)
|
||||
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketMbedTLS.cpp)
|
||||
elseif (APPLE AND NOT USE_OPEN_SSL)
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketAppleSSL.h)
|
||||
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketAppleSSL.cpp)
|
||||
elseif (WIN32)
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketSChannel.h)
|
||||
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketSChannel.cpp)
|
||||
else()
|
||||
set(USE_OPEN_SSL ON)
|
||||
set(USE_OPEN_SSL TRUE)
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketOpenSSL.h)
|
||||
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketOpenSSL.cpp)
|
||||
endif()
|
||||
@ -147,15 +145,19 @@ if (USE_TLS)
|
||||
target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_MBED_TLS)
|
||||
elseif (USE_OPEN_SSL)
|
||||
target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_OPEN_SSL)
|
||||
elseif (APPLE)
|
||||
elseif (WIN32)
|
||||
else()
|
||||
target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_OPEN_SSL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (APPLE AND USE_TLS AND NOT USE_MBED_TLS AND NOT USE_OPEN_SSL)
|
||||
if (APPLE AND USE_TLS AND NOT USE_MBED_TLS)
|
||||
target_link_libraries(ixwebsocket "-framework foundation" "-framework security")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(ixwebsocket wsock32 ws2_32 shlwapi)
|
||||
target_link_libraries(ixwebsocket wsock32 ws2_32)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
@ -172,9 +174,7 @@ if (USE_TLS AND USE_OPEN_SSL)
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /usr/local/opt/openssl/include)
|
||||
endif()
|
||||
|
||||
if(NOT OPENSSL_FOUND)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
endif()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
add_definitions(${OPENSSL_DEFINITIONS})
|
||||
message(STATUS "OpenSSL: " ${OPENSSL_VERSION})
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
@ -182,7 +182,6 @@ if (USE_TLS AND USE_OPEN_SSL)
|
||||
endif()
|
||||
|
||||
if (USE_TLS AND USE_MBED_TLS)
|
||||
# FIXME I'm not too sure that this USE_VENDORED_THIRD_PARTY thing works
|
||||
if (USE_VENDORED_THIRD_PARTY)
|
||||
set (ENABLE_PROGRAMS OFF)
|
||||
add_subdirectory(third_party/mbedtls)
|
||||
@ -207,7 +206,7 @@ else()
|
||||
endif()
|
||||
|
||||
set( IXWEBSOCKET_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
.
|
||||
)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
|
1
DOCKER_VERSION
Normal file
1
DOCKER_VERSION
Normal file
@ -0,0 +1 @@
|
||||
7.4.1
|
@ -1 +0,0 @@
|
||||
docker/Dockerfile.centos
|
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@ -0,0 +1,35 @@
|
||||
FROM alpine as build
|
||||
|
||||
RUN apk add --no-cache gcc g++ musl-dev linux-headers cmake openssl-dev
|
||||
RUN apk add --no-cache make
|
||||
RUN apk add --no-cache zlib-dev
|
||||
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
RUN chown -R app:app /opt
|
||||
RUN chown -R app:app /usr/local
|
||||
|
||||
# There is a bug in CMake where we cannot build from the root top folder
|
||||
# So we build from /opt
|
||||
COPY --chown=app:app . /opt
|
||||
WORKDIR /opt
|
||||
|
||||
USER app
|
||||
RUN [ "make", "ws_install" ]
|
||||
|
||||
FROM alpine as runtime
|
||||
|
||||
RUN apk add --no-cache libstdc++
|
||||
RUN apk add --no-cache strace
|
||||
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
|
||||
RUN chmod +x /usr/local/bin/ws
|
||||
RUN ldd /usr/local/bin/ws
|
||||
|
||||
# Now run in usermode
|
||||
USER app
|
||||
WORKDIR /home/app
|
||||
|
||||
ENTRYPOINT ["ws"]
|
||||
EXPOSE 8008
|
||||
CMD ["--help"]
|
18
README.md
18
README.md
@ -1,16 +1,16 @@
|
||||
## Hello world
|
||||
|
||||

|
||||

|
||||
|
||||
IXWebSocket is a C++ library for WebSocket client and server development. It has minimal dependencies (no boost), is very simple to use and support everything you'll likely need for websocket dev (SSL, deflate compression, compiles on most platforms, etc...). HTTP client and server code is also available, but it hasn't received as much testing.
|
||||
|
||||
It is been used on big mobile video game titles sending and receiving tons of messages since 2017 (iOS and Android). It was tested on macOS, iOS, Linux, Android, Windows and FreeBSD. Two important design goals are simplicity and correctness.
|
||||
|
||||
```cpp
|
||||
// Required on Windows
|
||||
# Required on Windows
|
||||
ix::initNetSystem();
|
||||
|
||||
// Our websocket object
|
||||
# Our websocket object
|
||||
ix::WebSocket webSocket;
|
||||
|
||||
std::string url("ws://localhost:8080/");
|
||||
@ -34,14 +34,8 @@ webSocket.start();
|
||||
webSocket.send("hello world");
|
||||
```
|
||||
|
||||
Interested? Go read the [docs](https://machinezone.github.io/IXWebSocket/)! If things don't work as expected, please create an issue on GitHub, or even better a pull request if you know how to fix your problem.
|
||||
Interested ? Go read the [docs](https://machinezone.github.io/IXWebSocket/) ! If things don't work as expected, please create an issue in github, or even better a pull request if you know how to fix your problem.
|
||||
|
||||
IXWebSocket is actively being developed, check out the [changelog](https://machinezone.github.io/IXWebSocket/CHANGELOG/) to know what's cooking. If you are looking for a real time messaging service (the chat-like 'server' your websocket code will talk to) with many features such as history, backed by Redis, look at [cobra](https://github.com/machinezone/cobra).
|
||||
IXWebSocket is actively being developed, check out the [changelog](CHANGELOG.md) to know what's cooking. If you are looking for a real time messaging service (the chat-like 'server' your websocket code will talk to) with many features such as history, backed by Redis, look at [cobra](https://github.com/machinezone/cobra).
|
||||
|
||||
IXWebSocket client code is autobahn compliant beginning with the 6.0.0 version. See the current [test results](https://bsergean.github.io/autobahn/reports/clients/index.html). Some tests are still failing in the server code.
|
||||
|
||||
## Users
|
||||
|
||||
If your company or project is using this library, feel free to open an issue or PR to amend this list.
|
||||
|
||||
- [Machine Zone](https://www.mz.com)
|
||||
IXWebSocket client code is autobahn compliant beginning with the 6.0.0 version. See the current [test results](https://bsergean.github.io/IXWebSocket/autobahn/index.html). Some tests are still failing in the server code.
|
||||
|
@ -18,50 +18,50 @@ services:
|
||||
# networks:
|
||||
# - ws-net
|
||||
|
||||
#pyproxy:
|
||||
# image: bsergean/ws_proxy:build
|
||||
# entrypoint: /usr/bin/ws_proxy.py --remote_url 'wss://cobra.addsrv.com' --host 0.0.0.0 --port 8765
|
||||
# ports:
|
||||
# - "8765:8765"
|
||||
# networks:
|
||||
# - ws-net
|
||||
pyproxy:
|
||||
image: bsergean/ws_proxy:build
|
||||
entrypoint: /usr/bin/ws_proxy.py --remote_url 'wss://cobra.addsrv.com' --host 0.0.0.0 --port 8765
|
||||
ports:
|
||||
- "8765:8765"
|
||||
networks:
|
||||
- ws-net
|
||||
|
||||
# # ws:
|
||||
# # security_opt:
|
||||
# # - seccomp:unconfined
|
||||
# # cap_add:
|
||||
# # - SYS_PTRACE
|
||||
# # stdin_open: true
|
||||
# # tty: true
|
||||
# # image: bsergean/ws:build
|
||||
# # entrypoint: sh
|
||||
# # networks:
|
||||
# # - ws-net
|
||||
# # depends_on:
|
||||
# # - redis1
|
||||
# #
|
||||
# # redis1:
|
||||
# # image: redis:alpine
|
||||
# # networks:
|
||||
# # - ws-net
|
||||
# #
|
||||
# # statsd:
|
||||
# # image: jaconel/statsd
|
||||
# # ports:
|
||||
# # - "8125:8125"
|
||||
# # environment:
|
||||
# # - STATSD_DUMP_MSG=true
|
||||
# # - GRAPHITE_HOST=127.0.0.1
|
||||
# # networks:
|
||||
# # - ws-net
|
||||
# ws:
|
||||
# security_opt:
|
||||
# - seccomp:unconfined
|
||||
# cap_add:
|
||||
# - SYS_PTRACE
|
||||
# stdin_open: true
|
||||
# tty: true
|
||||
# image: bsergean/ws:build
|
||||
# entrypoint: sh
|
||||
# networks:
|
||||
# - ws-net
|
||||
# depends_on:
|
||||
# - redis1
|
||||
#
|
||||
# redis1:
|
||||
# image: redis:alpine
|
||||
# networks:
|
||||
# - ws-net
|
||||
#
|
||||
# statsd:
|
||||
# image: jaconel/statsd
|
||||
# ports:
|
||||
# - "8125:8125"
|
||||
# environment:
|
||||
# - STATSD_DUMP_MSG=true
|
||||
# - GRAPHITE_HOST=127.0.0.1
|
||||
# networks:
|
||||
# - ws-net
|
||||
|
||||
compile:
|
||||
image: alpine
|
||||
entrypoint: sh
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
- /Users/bsergeant/src/foss:/home/bsergean/src/foss
|
||||
# compile:
|
||||
# image: alpine
|
||||
# entrypoint: sh
|
||||
# stdin_open: true
|
||||
# tty: true
|
||||
# volumes:
|
||||
# - /Users/bsergeant/src/foss:/home/bsergean/src/foss
|
||||
|
||||
networks:
|
||||
ws-net:
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.11 as build
|
||||
FROM alpine as build
|
||||
|
||||
RUN apk add --no-cache gcc g++ musl-dev linux-headers cmake openssl-dev
|
||||
RUN apk add --no-cache make
|
||||
@ -15,25 +15,20 @@ WORKDIR /opt
|
||||
|
||||
USER app
|
||||
RUN [ "make", "ws_install" ]
|
||||
RUN [ "rm", "-rf", "build" ]
|
||||
|
||||
FROM alpine:3.11 as runtime
|
||||
FROM alpine as runtime
|
||||
|
||||
RUN apk add --no-cache libstdc++
|
||||
RUN apk add --no-cache strace
|
||||
RUN apk add --no-cache gdb
|
||||
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
|
||||
RUN chmod +x /usr/local/bin/ws
|
||||
RUN ldd /usr/local/bin/ws
|
||||
|
||||
# Copy source code for gcc
|
||||
COPY --chown=app:app --from=build /opt /opt
|
||||
|
||||
# Now run in usermode
|
||||
USER app
|
||||
WORKDIR /home/app
|
||||
|
||||
ENTRYPOINT ["ws"]
|
||||
EXPOSE 8008
|
||||
CMD ["--help"]
|
||||
|
@ -1,35 +0,0 @@
|
||||
FROM centos:8 as build
|
||||
|
||||
RUN yum install -y gcc-c++ make cmake zlib-devel openssl-devel redhat-rpm-config
|
||||
|
||||
RUN groupadd app && useradd -g app app
|
||||
RUN chown -R app:app /opt
|
||||
RUN chown -R app:app /usr/local
|
||||
|
||||
# There is a bug in CMake where we cannot build from the root top folder
|
||||
# So we build from /opt
|
||||
COPY --chown=app:app . /opt
|
||||
WORKDIR /opt
|
||||
|
||||
USER app
|
||||
RUN [ "make", "ws_install" ]
|
||||
RUN [ "rm", "-rf", "build" ]
|
||||
|
||||
FROM centos:8 as runtime
|
||||
|
||||
RUN yum install -y gdb strace
|
||||
|
||||
RUN groupadd app && useradd -g app app
|
||||
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
|
||||
RUN chmod +x /usr/local/bin/ws
|
||||
RUN ldd /usr/local/bin/ws
|
||||
|
||||
# Copy source code for gcc
|
||||
COPY --chown=app:app --from=build /opt /opt
|
||||
|
||||
# Now run in usermode
|
||||
USER app
|
||||
WORKDIR /home/app
|
||||
|
||||
ENTRYPOINT ["ws"]
|
||||
EXPOSE 8008
|
@ -1,235 +1,5 @@
|
||||
# Changelog
|
||||
All changes to this project will be documented in this file.
|
||||
|
||||
## [8.1.4] - 2020-02-22
|
||||
|
||||
(websocket server) fix regression from 8.1.2, where per-deflate message compression was always disabled
|
||||
|
||||
## [8.1.3] - 2020-02-21
|
||||
|
||||
(client + server) Fix #155 / http header parser should treat the space(s) after the : delimiter as optional. Fixing this bug made us discover that websocket sub-protocols are not properly serialiazed, but start with a ,
|
||||
|
||||
## [8.1.2] - 2020-02-18
|
||||
|
||||
(WebSocketServer) add option to disable deflate compression, exposed with the -x option to ws echo_server
|
||||
|
||||
## [8.1.1] - 2020-02-18
|
||||
|
||||
(ws cobra to statsd and sentry sender) exit if no messages are received for one minute, which is a sign that something goes wrong on the server side. That should be changed to be configurable in the future
|
||||
|
||||
## [8.1.0] - 2020-02-13
|
||||
|
||||
(http client + sentry minidump upload) Multipart stream closing boundary is invalid + mark some options as mandatory in the command line tools
|
||||
|
||||
## [8.0.7] - 2020-02-12
|
||||
|
||||
(build) remove the unused subtree which was causing some way of installing to break
|
||||
|
||||
## [8.0.6] - 2020-01-31
|
||||
|
||||
(snake) add an option to disable answering pongs as response to pings, to test cobra client behavior with hanged connections
|
||||
|
||||
## [8.0.5] - 2020-01-31
|
||||
|
||||
(IXCobraConnection) set a ping timeout of 90 seconds. If no pong messages are received as responses to ping for a while, give up and close the connection
|
||||
|
||||
## [8.0.4] - 2020-01-31
|
||||
|
||||
(cobra to sentry) remove noisy logging
|
||||
|
||||
## [8.0.3] - 2020-01-30
|
||||
|
||||
(ixcobra) check if we are authenticated in publishNext before trying to publish a message
|
||||
|
||||
## [8.0.2] - 2020-01-28
|
||||
|
||||
Extract severity level when emitting messages to sentry
|
||||
|
||||
## [8.0.1] - 2020-01-28
|
||||
|
||||
Fix bug #151 - If a socket connection is interrupted, calling stop() on the IXWebSocket object blocks until the next retry
|
||||
|
||||
## [8.0.0] - 2020-01-26
|
||||
|
||||
(SocketServer) add ability to bind on an ipv6 address
|
||||
|
||||
## [7.9.6] - 2020-01-22
|
||||
|
||||
(ws) add a dnslookup sub-command, to get the ip address of a remote host
|
||||
|
||||
## [7.9.5] - 2020-01-14
|
||||
|
||||
(windows) fix #144, get rid of stubbed/un-implemented windows schannel ssl backend
|
||||
|
||||
## [7.9.4] - 2020-01-12
|
||||
|
||||
(openssl + mbedssl) fix #140, can send large files with ws send over ssl / still broken with apple ssl
|
||||
|
||||
## [7.9.3] - 2020-01-10
|
||||
|
||||
(apple ssl) model write method after the OpenSSL one for consistency
|
||||
|
||||
## [7.9.2] - 2020-01-06
|
||||
|
||||
(apple ssl) unify read and write ssl utility code
|
||||
|
||||
## [7.9.1] - 2020-01-06
|
||||
|
||||
(websocket client) better error propagation when errors are detected while sending data
|
||||
(ws send) detect failures to send big files, terminate in those cases and report error
|
||||
|
||||
## [7.9.0] - 2020-01-04
|
||||
|
||||
(ws send) add option (-x) to disable per message deflate compression
|
||||
|
||||
## [7.8.9] - 2020-01-04
|
||||
|
||||
(ws send + receive) handle all message types (ping + pong + fragment) / investigate #140
|
||||
|
||||
## [7.8.8] - 2019-12-28
|
||||
|
||||
(mbedtls) fix related to private key file parsing and initialization
|
||||
|
||||
## [7.8.6] - 2019-12-28
|
||||
|
||||
(ws cobra to sentry/statsd) fix for handling null events properly for empty queues + use queue to send data to statsd
|
||||
|
||||
## [7.8.5] - 2019-12-28
|
||||
|
||||
(ws cobra to sentry) handle null events for empty queues
|
||||
|
||||
## [7.8.4] - 2019-12-27
|
||||
|
||||
(ws cobra to sentry) game is picked in a fair manner, so that all games get the same share of sent events
|
||||
|
||||
## [7.8.3] - 2019-12-27
|
||||
|
||||
(ws cobra to sentry) refactor queue related code into a class
|
||||
|
||||
## [7.8.2] - 2019-12-25
|
||||
|
||||
(ws cobra to sentry) bound the queue size used to hold up cobra messages before they are sent to sentry. Default queue size is a 100 messages. Without such limit the program runs out of memory when a subscriber receive a lot of messages that cannot make it to sentry
|
||||
|
||||
## [7.8.1] - 2019-12-25
|
||||
|
||||
(ws client) use correct compilation defines so that spdlog is not used as a header only library (reduce binary size and increase compilation speed)
|
||||
|
||||
## [7.8.0] - 2019-12-24
|
||||
|
||||
(ws client) all commands use spdlog instead of std::cerr or std::cout for logging
|
||||
|
||||
## [7.6.5] - 2019-12-24
|
||||
|
||||
(cobra client) send a websocket ping every 30s to keep the connection opened
|
||||
|
||||
## [7.6.4] - 2019-12-22
|
||||
|
||||
(client) error handling, quote url in error case when failing to parse one
|
||||
(ws) ws_cobra_publish: register callbacks before connecting
|
||||
(doc) mention mbedtls in supported ssl server backend
|
||||
|
||||
## [7.6.3] - 2019-12-20
|
||||
|
||||
(tls) add a simple description of the TLS configuration routine for debugging
|
||||
|
||||
## [7.6.2] - 2019-12-20
|
||||
|
||||
(mbedtls) correct support for using own certificate and private key
|
||||
|
||||
## [7.6.1] - 2019-12-20
|
||||
|
||||
(ws commands) in websocket proxy, disable automatic reconnections + in Dockerfile, use alpine 3.11
|
||||
|
||||
## [7.6.0] - 2019-12-19
|
||||
|
||||
(cobra) Add TLS options to all cobra commands and classes. Add example to the doc.
|
||||
|
||||
## [7.5.8] - 2019-12-18
|
||||
|
||||
(cobra-to-sentry) capture application version from device field
|
||||
|
||||
## [7.5.7] - 2019-12-18
|
||||
|
||||
(tls) Experimental TLS server support with mbedtls (windows) + process cert tlsoption (client + server)
|
||||
|
||||
## [7.5.6] - 2019-12-18
|
||||
|
||||
(tls servers) Make it clear that apple ssl and mbedtls backends do not support SSL in server mode
|
||||
|
||||
## [7.5.5] - 2019-12-17
|
||||
|
||||
(tls options client) TLSOptions struct _validated member should be initialized to false
|
||||
|
||||
## [7.5.4] - 2019-12-16
|
||||
|
||||
(websocket client) improve the error message when connecting to a non websocket server
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
Connection error: Got bad status connecting to example.com:443, status: 200, HTTP Status line: HTTP/1.1 200 OK
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
Connection error: Expecting status 101 (Switching Protocol), got 200 status connecting to example.com:443, HTTP Status line: HTTP/1.1 200 OK
|
||||
```
|
||||
|
||||
## [7.5.3] - 2019-12-12
|
||||
|
||||
(server) attempt at fixing #131 by using blocking writes in server mode
|
||||
|
||||
## [7.5.2] - 2019-12-11
|
||||
|
||||
(ws) cobra to sentry - created events with sentry tags based on tags present in the cobra messages
|
||||
|
||||
## [7.5.1] - 2019-12-06
|
||||
|
||||
(mac) convert SSL errors to utf8
|
||||
|
||||
## [7.5.0] - 2019-12-05
|
||||
|
||||
- (ws) cobra to sentry. Handle Error 429 Too Many Requests and politely wait before sending more data to sentry.
|
||||
|
||||
In the example below sentry we are sending data too fast, sentry asks us to slow down which we do. Notice how the sent count stop increasing, while we are waiting for 41 seconds.
|
||||
|
||||
```
|
||||
[2019-12-05 15:50:33.759] [info] messages received 2449 sent 3
|
||||
[2019-12-05 15:50:34.759] [info] messages received 5533 sent 7
|
||||
[2019-12-05 15:50:35.759] [info] messages received 8612 sent 11
|
||||
[2019-12-05 15:50:36.759] [info] messages received 11562 sent 15
|
||||
[2019-12-05 15:50:37.759] [info] messages received 14410 sent 19
|
||||
[2019-12-05 15:50:38.759] [info] messages received 17236 sent 23
|
||||
[2019-12-05 15:50:39.282] [error] Error sending data to sentry: 429
|
||||
[2019-12-05 15:50:39.282] [error] Body: {"exception":[{"stacktrace":{"frames":[{"filename":"WorldScene.lua","function":"WorldScene.lua:1935","lineno":1958},{"filename":"WorldScene.lua","function":"onUpdate_WorldCam","lineno":1921},{"filename":"WorldMapTile.lua","function":"__index","lineno":239}]},"value":"noisytypes: Attempt to call nil(nil,2224139838)!"}],"platform":"python","sdk":{"name":"ws","version":"1.0.0"},"tags":[["game","niso"],["userid","107638363"],["environment","live"]],"timestamp":"2019-12-05T23:50:39Z"}
|
||||
|
||||
[2019-12-05 15:50:39.282] [error] Response: {"error_name":"rate_limit","error":"Creation of this event was denied due to rate limiting"}
|
||||
[2019-12-05 15:50:39.282] [warning] Error 429 - Too Many Requests. ws will sleep and retry after 41 seconds
|
||||
[2019-12-05 15:50:39.760] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:40.760] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:41.760] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:42.761] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:43.762] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:44.763] [info] messages received 18839 sent 25
|
||||
[2019-12-05 15:50:45.768] [info] messages received 18839 sent 25
|
||||
```
|
||||
|
||||
## [7.4.5] - 2019-12-03
|
||||
|
||||
- (ws) #125 / fix build problem when jsoncpp is not installed locally
|
||||
|
||||
## [7.4.4] - 2019-12-03
|
||||
|
||||
- (ws) #125 / cmake detects an already installed jsoncpp and will try to use this one if present
|
||||
|
||||
## [7.4.3] - 2019-12-03
|
||||
|
||||
- (http client) use std::unordered_map instead of std::map for HttpParameters and HttpFormDataParameters class aliases
|
||||
|
||||
## [7.4.2] - 2019-12-02
|
||||
|
||||
- (client) internal IXDNSLookup class requires a valid cancellation request function callback to be passed in
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [7.4.1] - 2019-12-02
|
||||
|
||||
|
@ -23,16 +23,6 @@ Options for building:
|
||||
|
||||
If you are on Windows, look at the [appveyor](https://github.com/machinezone/IXWebSocket/blob/master/appveyor.yml) file that has instructions for building dependencies.
|
||||
|
||||
It is also possible to externally include the project, so that everything is fetched over the wire when you build like so:
|
||||
|
||||
```
|
||||
ExternalProject_Add(
|
||||
IXWebSocket
|
||||
GIT_REPOSITORY https://github.com/machinezone/IXWebSocket.git
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
### vcpkg
|
||||
|
||||
It is possible to get IXWebSocket through Microsoft [vcpkg](https://github.com/microsoft/vcpkg).
|
||||
@ -43,16 +33,11 @@ vcpkg install ixwebsocket
|
||||
|
||||
### Conan
|
||||
|
||||
[  ](https://bintray.com/conan/conan-center/ixwebsocket%3A_/_latestVersion)
|
||||
Support for building with conan was contributed by Olivia Zoe (thanks !). The package name to reference is `IXWebSocket/5.0.0@LunarWatcher/stable`. The package is in the process to be published to the official conan package repo, but in the meantime, it can be accessed by adding a new remote
|
||||
|
||||
Conan is currently supported through a recipe in [Conan Center](https://github.com/conan-io/conan-center-index/tree/master/recipes/ixwebsocket) ([Bintray entry](https://bintray.com/conan/conan-center/ixwebsocket%3A_)).
|
||||
|
||||
Package reference
|
||||
|
||||
* Conan 1.21.0 and up: `ixwebsocket/7.9.2`
|
||||
* Earlier versions: `ixwebsocket/7.9.2@_/_`
|
||||
|
||||
Note that the version listed here might not be the latest one. See Bintray or the recipe itself for the latest version. If you're migrating from the previous, custom Bintray remote, note that the package reference _has_ to be lower-case.
|
||||
```
|
||||
conan remote add remote_name_here https://api.bintray.com/conan/oliviazoe0/conan-packages
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
|
@ -8,7 +8,7 @@ Bring up 3 terminals and run a server, a publisher and a subscriber in each one.
|
||||
|
||||
You will need to have a redis server running locally. To run the server:
|
||||
|
||||
```bash
|
||||
```
|
||||
$ cd <ixwebsocket-top-level-folder>/ixsnake/ixsnake
|
||||
$ ws snake
|
||||
{
|
||||
@ -33,7 +33,7 @@ redis port: 6379
|
||||
|
||||
### Publisher
|
||||
|
||||
```bash
|
||||
```
|
||||
$ cd <ixwebsocket-top-level-folder>/ws
|
||||
$ ws cobra_publish --appkey FC2F10139A2BAc53BB72D9db967b024f --endpoint ws://127.0.0.1:8008 --rolename _pub --rolesecret 1c04DB8fFe76A4EeFE3E318C72d771db test_channel cobraMetricsSample.json
|
||||
[2019-11-27 09:06:12.980] [info] Publisher connected
|
||||
@ -49,7 +49,7 @@ $ ws cobra_publish --appkey FC2F10139A2BAc53BB72D9db967b024f --endpoint ws://127
|
||||
|
||||
### Subscriber
|
||||
|
||||
```bash
|
||||
```
|
||||
$ ws cobra_subscribe --appkey FC2F10139A2BAc53BB72D9db967b024f --endpoint ws://127.0.0.1:8008 --rolename _pub --rolesecret 1c04DB8fFe76A4EeFE3E318C72d771db test_channel
|
||||
#messages 0 msg/s 0
|
||||
[2019-11-27 09:07:39.341] [info] Subscriber connected
|
||||
|
@ -24,7 +24,7 @@ Large frames are broken up into smaller chunks or messages to avoid filling up t
|
||||
|
||||
The library has an interactive tool which is handy for testing compatibility ith other libraries. We have tested our client against Python, Erlang, Node.js, and C++ websocket server libraries.
|
||||
|
||||
The unittest tries to be comprehensive, and has been running on multiple platforms, with different sanitizers such as a thread sanitizer to catch data races or the undefined behavior sanitizer.
|
||||
The unittest tries to be comprehensive, and has been running on multiple platoform, with different sanitizers such as thread sanitizer to catch data races or the undefined behavior sanitizer.
|
||||
|
||||
The regression test is running after each commit on travis.
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
|
||||
## Example code
|
||||
|
||||
```cpp
|
||||
// Required on Windows
|
||||
```
|
||||
# Required on Windows
|
||||
ix::initNetSystem();
|
||||
|
||||
// Our websocket object
|
||||
# Our websocket object
|
||||
ix::WebSocket webSocket;
|
||||
|
||||
std::string url("ws://localhost:8080/");
|
||||
@ -40,7 +40,7 @@ webSocket.start();
|
||||
webSocket.send("hello world");
|
||||
```
|
||||
|
||||
## Why another library?
|
||||
## Why another library ?
|
||||
|
||||
There are 2 main reasons that explain why IXWebSocket got written. First, we needed a C++ cross-platform client library, which should have few dependencies. What looked like the most solid one, [websocketpp](https://github.com/zaphoyd/websocketpp) did depend on boost and this was not an option for us. Secondly, there were other available libraries with fewer dependencies (C ones), but they required calling an explicit poll routine periodically to know if a client had received data from a server, which was not elegant.
|
||||
|
||||
@ -48,4 +48,4 @@ We started by solving those 2 problems, then we added server websocket code, the
|
||||
|
||||
## Contributing
|
||||
|
||||
IXWebSocket is developed on [GitHub](https://github.com/machinezone/IXWebSocket). We'd love to hear about how you use it; opening up an issue on GitHub is ok for that. If things don't work as expected, please create an issue on GitHub, or even better a pull request if you know how to fix your problem.
|
||||
IXWebSocket is developed on [github](https://github.com/machinezone/IXWebSocket). We'd love to hear about how you use it ; opening up an issue in github is ok for that. If things don't work as expected, please create an issue in github, or even better a pull request if you know how to fix your problem.
|
||||
|
@ -6,7 +6,7 @@ The [*ws*](https://github.com/machinezone/IXWebSocket/tree/master/ws) folder cou
|
||||
|
||||
To use the network system on Windows, you need to initialize it once with *WSAStartup()* and clean it up with *WSACleanup()*. We have helpers for that which you can use, see below. This init would typically take place in your main function.
|
||||
|
||||
```cpp
|
||||
```
|
||||
#include <ixwebsocket/IXNetSystem.h>
|
||||
|
||||
int main()
|
||||
@ -22,12 +22,12 @@ int main()
|
||||
|
||||
## WebSocket client API
|
||||
|
||||
```cpp
|
||||
```
|
||||
#include <ixwebsocket/IXWebSocket.h>
|
||||
|
||||
...
|
||||
|
||||
// Our websocket object
|
||||
# Our websocket object
|
||||
ix::WebSocket webSocket;
|
||||
|
||||
std::string url("ws://localhost:8080/");
|
||||
@ -82,9 +82,9 @@ If the connection was closed and sending failed, the return value will be set to
|
||||
|
||||
### Open and Close notifications
|
||||
|
||||
The onMessage event will be fired when the connection is opened or closed. This is similar to the [JavaScript browser API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), which has `open` and `close` events notification that can be registered with the browser `addEventListener`.
|
||||
The onMessage event will be fired when the connection is opened or closed. This is similar to the [Javascript browser API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), which has `open` and `close` events notification that can be registered with the browser `addEventListener`.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
{
|
||||
if (msg->type == ix::WebSocketMessageType::Open)
|
||||
@ -115,7 +115,7 @@ webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
|
||||
A message will be fired when there is an error with the connection. The message type will be `ix::WebSocketMessageType::Error`. Multiple fields will be available on the event to describe the error.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
{
|
||||
if (msg->type == ix::WebSocketMessageType::Error)
|
||||
@ -140,7 +140,7 @@ webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
|
||||
The url can be set and queried after a websocket object has been created. You will have to call `stop` and `start` if you want to disconnect and connect to that new url.
|
||||
|
||||
```cpp
|
||||
```
|
||||
std::string url("wss://example.com");
|
||||
websocket.configure(url);
|
||||
```
|
||||
@ -149,7 +149,7 @@ websocket.configure(url);
|
||||
|
||||
Ping/pong messages are used to implement keep-alive. 2 message types exists to identify ping and pong messages. Note that when a ping message is received, a pong is instantly send back as requested by the WebSocket spec.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
{
|
||||
if (msg->type == ix::WebSocketMessageType::Ping ||
|
||||
@ -163,7 +163,7 @@ webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
|
||||
|
||||
A ping message can be sent to the server, with an optional data string.
|
||||
|
||||
```cpp
|
||||
```
|
||||
websocket.ping("ping data, optional (empty string is ok): limited to 125 bytes long");
|
||||
```
|
||||
|
||||
@ -173,7 +173,7 @@ You can configure an optional heart beat / keep-alive, sent every 45 seconds
|
||||
when there is no any traffic to make sure that load balancers do not kill an
|
||||
idle connection.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setHeartBeatPeriod(45);
|
||||
```
|
||||
|
||||
@ -181,7 +181,7 @@ webSocket.setHeartBeatPeriod(45);
|
||||
|
||||
You can set extra HTTP headers to be sent during the WebSocket handshake.
|
||||
|
||||
```cpp
|
||||
```
|
||||
WebSocketHttpHeaders headers;
|
||||
headers["foo"] = "bar";
|
||||
webSocket.setExtraHeaders(headers);
|
||||
@ -191,14 +191,14 @@ webSocket.setExtraHeaders(headers);
|
||||
|
||||
You can specify subprotocols to be set during the WebSocket handshake. For more info you can refer to [this doc](https://hpbn.co/websocket/#subprotocol-negotiation).
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.addSubprotocol("appProtocol-v1");
|
||||
webSocket.addSubprotocol("appProtocol-v2");
|
||||
```
|
||||
|
||||
The protocol that the server did accept is available in the open info `protocol` field.
|
||||
|
||||
```cpp
|
||||
```
|
||||
std::cout << "protocol: " << msg->openInfo.protocol << std::endl;
|
||||
```
|
||||
|
||||
@ -206,7 +206,7 @@ std::cout << "protocol: " << msg->openInfo.protocol << std::endl;
|
||||
|
||||
Automatic reconnection kicks in when the connection is disconnected without the user consent. This feature is on by default and can be turned off.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.enableAutomaticReconnection(); // turn on
|
||||
webSocket.disableAutomaticReconnection(); // turn off
|
||||
bool enabled = webSocket.isAutomaticReconnectionEnabled(); // query state
|
||||
@ -239,7 +239,7 @@ Wait time(ms): 10000
|
||||
|
||||
The waiting time is capped by default at 10s between 2 attempts, but that value can be changed and queried.
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setMaxWaitBetweenReconnectionRetries(5 * 1000); // 5000ms = 5s
|
||||
uint32_t m = webSocket.getMaxWaitBetweenReconnectionRetries();
|
||||
```
|
||||
@ -253,7 +253,7 @@ Then, secure sockets are automatically used when connecting to a `wss://*` url.
|
||||
Additional TLS options can be configured by passing a `ix::SocketTLSOptions` instance to the
|
||||
`setTLSOptions` on `ix::WebSocket` (or `ix::WebSocketServer` or `ix::HttpServer`)
|
||||
|
||||
```cpp
|
||||
```
|
||||
webSocket.setTLSOptions({
|
||||
.certFile = "path/to/cert/file.pem",
|
||||
.keyFile = "path/to/key/file.pem",
|
||||
@ -279,7 +279,7 @@ For a server, specifying `caFile` implies that:
|
||||
|
||||
## WebSocket server API
|
||||
|
||||
```cpp
|
||||
```
|
||||
#include <ixwebsocket/IXWebSocketServer.h>
|
||||
|
||||
...
|
||||
@ -344,7 +344,7 @@ server.wait();
|
||||
|
||||
## HTTP client API
|
||||
|
||||
```cpp
|
||||
```
|
||||
#include <ixwebsocket/IXHttpClient.h>
|
||||
|
||||
...
|
||||
@ -427,7 +427,7 @@ bool ok = httpClient.performRequest(args, [](const HttpResponsePtr& response)
|
||||
|
||||
## HTTP server API
|
||||
|
||||
```cpp
|
||||
```
|
||||
#include <ixwebsocket/IXHttpServer.h>
|
||||
|
||||
ix::HttpServer server(port, hostname);
|
||||
@ -445,7 +445,7 @@ server.wait();
|
||||
|
||||
If you want to handle how requests are processed, implement the setOnConnectionCallback callback, which takes an HttpRequestPtr as input, and returns an HttpResponsePtr. You can look at HttpServer::setDefaultConnectionCallback for a slightly more advanced callback example.
|
||||
|
||||
```cpp
|
||||
```
|
||||
setOnConnectionCallback(
|
||||
[this](HttpRequestPtr request,
|
||||
std::shared_ptr<ConnectionState> /*connectionState*/) -> HttpResponsePtr
|
||||
|
125
docs/ws.md
125
docs/ws.md
@ -243,127 +243,6 @@ Options:
|
||||
--transfer-timeout INT Transfer timeout
|
||||
```
|
||||
|
||||
## Cobra client and server
|
||||
## Cobra Client
|
||||
|
||||
[cobra](https://github.com/machinezone/cobra) is a real time messenging server. ws has several sub-command to interact with cobra. There is also a minimal cobra compatible server named snake available.
|
||||
|
||||
Below are examples on running a snake server and clients with TLS enabled (the server only works with the OpenSSL and the Mbed TLS backend for now).
|
||||
|
||||
First, generate certificates.
|
||||
|
||||
```
|
||||
$ cd /path/to/IXWebSocket
|
||||
$ cd ixsnake/ixsnake
|
||||
$ bash ../../ws/generate_certs.sh
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
.....+++
|
||||
.................+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/trusted-ca-key.pem
|
||||
generated ./.certs/trusted-ca-crt.pem
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
..+++
|
||||
.......................................+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/trusted-server-key.pem
|
||||
Signature ok
|
||||
subject=/O=machinezone/O=IXWebSocket/CN=trusted-server
|
||||
Getting CA Private Key
|
||||
generated ./.certs/trusted-server-crt.pem
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
...................................+++
|
||||
..................................................+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/trusted-client-key.pem
|
||||
Signature ok
|
||||
subject=/O=machinezone/O=IXWebSocket/CN=trusted-client
|
||||
Getting CA Private Key
|
||||
generated ./.certs/trusted-client-crt.pem
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
..............+++
|
||||
.......................................+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/untrusted-ca-key.pem
|
||||
generated ./.certs/untrusted-ca-crt.pem
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
..........+++
|
||||
................................................+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/untrusted-client-key.pem
|
||||
Signature ok
|
||||
subject=/O=machinezone/O=IXWebSocket/CN=untrusted-client
|
||||
Getting CA Private Key
|
||||
generated ./.certs/untrusted-client-crt.pem
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
.....................................................................................+++
|
||||
...........+++
|
||||
e is 65537 (0x10001)
|
||||
generated ./.certs/selfsigned-client-key.pem
|
||||
Signature ok
|
||||
subject=/O=machinezone/O=IXWebSocket/CN=selfsigned-client
|
||||
Getting Private key
|
||||
generated ./.certs/selfsigned-client-crt.pem
|
||||
```
|
||||
|
||||
Now run the snake server.
|
||||
|
||||
```
|
||||
$ export certs=.certs
|
||||
$ ws snake --tls --port 8765 --cert-file ${certs}/trusted-server-crt.pem --key-file ${certs}/trusted-server-key.pem --ca-file ${certs}/trusted-ca-crt.pem
|
||||
{
|
||||
"apps": {
|
||||
"FC2F10139A2BAc53BB72D9db967b024f": {
|
||||
"roles": {
|
||||
"_sub": {
|
||||
"secret": "66B1dA3ED5fA074EB5AE84Dd8CE3b5ba"
|
||||
},
|
||||
"_pub": {
|
||||
"secret": "1c04DB8fFe76A4EeFE3E318C72d771db"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
redis host: 127.0.0.1
|
||||
redis password:
|
||||
redis port: 6379
|
||||
```
|
||||
|
||||
As a new connection comes in, such output should be printed
|
||||
|
||||
```
|
||||
[2019-12-19 20:27:19.724] [info] New connection
|
||||
id: 0
|
||||
Uri: /v2?appkey=_health
|
||||
Headers:
|
||||
Connection: Upgrade
|
||||
Host: 127.0.0.1:8765
|
||||
Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15; client_max_window_bits=15
|
||||
Sec-WebSocket-Key: d747B0fE61Db73f7Eh47c0==
|
||||
Sec-WebSocket-Protocol: json
|
||||
Sec-WebSocket-Version: 13
|
||||
Upgrade: websocket
|
||||
User-Agent: ixwebsocket/7.5.8 macos ssl/OpenSSL OpenSSL 1.0.2q 20 Nov 2018 zlib 1.2.11
|
||||
```
|
||||
|
||||
To connect and publish a message, do:
|
||||
|
||||
```
|
||||
$ export certs=.certs
|
||||
$ cd /path/to/ws/folder
|
||||
$ ls cobraMetricsSample.json
|
||||
cobraMetricsSample.json
|
||||
$ ws cobra_publish --endpoint wss://127.0.0.1:8765 --appkey FC2F10139A2BAc53BB72D9db967b024f --rolename _pub --rolesecret 1c04DB8fFe76A4EeFE3E318C72d771db --channel foo --cert-file ${certs}/trusted-client-crt.pem --key-file ${certs}/trusted-client-key.pem --ca-file ${certs}/trusted-ca-crt.pem cobraMetricsSample.json
|
||||
[2019-12-19 20:46:42.656] [info] Publisher connected
|
||||
[2019-12-19 20:46:42.657] [info] Connection: Upgrade
|
||||
[2019-12-19 20:46:42.657] [info] Sec-WebSocket-Accept: rs99IFThoBrhSg+k8G4ixH9yaq4=
|
||||
[2019-12-19 20:46:42.657] [info] Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15; client_max_window_bits=15
|
||||
[2019-12-19 20:46:42.657] [info] Server: ixwebsocket/7.5.8 macos ssl/OpenSSL OpenSSL 1.0.2q 20 Nov 2018 zlib 1.2.11
|
||||
[2019-12-19 20:46:42.657] [info] Upgrade: websocket
|
||||
[2019-12-19 20:46:42.658] [info] Publisher authenticated
|
||||
[2019-12-19 20:46:42.658] [info] Published msg 3
|
||||
[2019-12-19 20:46:42.659] [info] Published message id 3 acked
|
||||
```
|
||||
|
||||
To use OpenSSL on macOS, compile with `make ws_openssl`. First you will have to install OpenSSL libraries, which can be done with Homebrew. Use `make ws_mbedtls` accordingly to use MbedTLS.
|
||||
[cobra](https://github.com/machinezone/cobra) is a real time messenging server. ws has sub-command to interacti with cobra.
|
||||
|
@ -20,16 +20,11 @@ add_library(ixcobra STATIC
|
||||
${IXCOBRA_HEADERS}
|
||||
)
|
||||
|
||||
find_package(JsonCpp)
|
||||
if (NOT JSONCPP_FOUND)
|
||||
set(JSONCPP_INCLUDE_DIRS ../third_party/jsoncpp)
|
||||
endif()
|
||||
|
||||
set(IXCOBRA_INCLUDE_DIRS
|
||||
.
|
||||
..
|
||||
../ixcore
|
||||
../ixcrypto
|
||||
${JSONCPP_INCLUDE_DIRS})
|
||||
../third_party)
|
||||
|
||||
target_include_directories( ixcobra PUBLIC ${IXCOBRA_INCLUDE_DIRS} )
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "IXCobraConnection.h"
|
||||
#include <ixcrypto/IXHMac.h>
|
||||
#include <ixwebsocket/IXWebSocket.h>
|
||||
#include <ixwebsocket/IXSocketTLSOptions.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
@ -15,7 +14,6 @@
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace ix
|
||||
@ -24,7 +22,6 @@ namespace ix
|
||||
PublishTrackerCallback CobraConnection::_publishTrackerCallback = nullptr;
|
||||
constexpr size_t CobraConnection::kQueueMaxSize;
|
||||
constexpr CobraConnection::MsgId CobraConnection::kInvalidMsgId;
|
||||
constexpr int CobraConnection::kPingIntervalSecs;
|
||||
|
||||
CobraConnection::CobraConnection() :
|
||||
_webSocket(new WebSocket()),
|
||||
@ -229,10 +226,6 @@ namespace ix
|
||||
ss << "HTTP Status: " << msg->errorInfo.http_status << std::endl;
|
||||
invokeErrorCallback(ss.str(), std::string());
|
||||
}
|
||||
else if (msg->type == ix::WebSocketMessageType::Pong)
|
||||
{
|
||||
invokeEventCallback(ix::CobraConnection_EventType_Pong);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -250,8 +243,7 @@ namespace ix
|
||||
const std::string& endpoint,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
const WebSocketPerMessageDeflateOptions& webSocketPerMessageDeflateOptions,
|
||||
const SocketTLSOptions& socketTLSOptions)
|
||||
const WebSocketPerMessageDeflateOptions& webSocketPerMessageDeflateOptions)
|
||||
{
|
||||
_roleName = rolename;
|
||||
_roleSecret = rolesecret;
|
||||
@ -264,16 +256,6 @@ namespace ix
|
||||
std::string url = ss.str();
|
||||
_webSocket->setUrl(url);
|
||||
_webSocket->setPerMessageDeflateOptions(webSocketPerMessageDeflateOptions);
|
||||
_webSocket->setTLSOptions(socketTLSOptions);
|
||||
|
||||
// Send a websocket ping every N seconds (N = 30) now
|
||||
// This should keep the connection open and prevent some load balancers such as
|
||||
// the Amazon one from shutting it down
|
||||
_webSocket->setPingInterval(kPingIntervalSecs);
|
||||
|
||||
// If we don't receive a pong back, declare loss after 3 * N seconds
|
||||
// (will be 90s now), and close and restart the connection
|
||||
_webSocket->setPingTimeout(3 * kPingIntervalSecs);
|
||||
}
|
||||
|
||||
//
|
||||
@ -514,7 +496,7 @@ namespace ix
|
||||
if (_messageQueue.empty()) return true;
|
||||
|
||||
auto&& msg = _messageQueue.back();
|
||||
if (!_authenticated || !publishMessage(msg))
|
||||
if (!publishMessage(msg))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <ixwebsocket/IXWebSocketHttpHeaders.h>
|
||||
#include <ixwebsocket/IXWebSocketPerMessageDeflateOptions.h>
|
||||
#include <json/json.h>
|
||||
#include <jsoncpp/json/json.h>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
@ -20,7 +20,6 @@
|
||||
namespace ix
|
||||
{
|
||||
class WebSocket;
|
||||
struct SocketTLSOptions;
|
||||
|
||||
enum CobraConnectionEventType
|
||||
{
|
||||
@ -30,8 +29,7 @@ namespace ix
|
||||
CobraConnection_EventType_Closed = 3,
|
||||
CobraConnection_EventType_Subscribed = 4,
|
||||
CobraConnection_EventType_UnSubscribed = 5,
|
||||
CobraConnection_EventType_Published = 6,
|
||||
CobraConnection_EventType_Pong = 7
|
||||
CobraConnection_EventType_Published = 6
|
||||
};
|
||||
|
||||
enum CobraConnectionPublishMode
|
||||
@ -64,8 +62,7 @@ namespace ix
|
||||
const std::string& endpoint,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
const WebSocketPerMessageDeflateOptions& webSocketPerMessageDeflateOptions,
|
||||
const SocketTLSOptions& socketTLSOptions);
|
||||
const WebSocketPerMessageDeflateOptions& webSocketPerMessageDeflateOptions);
|
||||
|
||||
/// Set the traffic tracker callback
|
||||
static void setTrafficTrackerCallback(const TrafficTrackerCallback& callback);
|
||||
@ -216,9 +213,6 @@ namespace ix
|
||||
|
||||
// Each pdu sent should have an incremental unique id
|
||||
std::atomic<uint64_t> _id;
|
||||
|
||||
// Frequency at which we send a websocket ping to the backing cobra connection
|
||||
static constexpr int kPingIntervalSecs = 30;
|
||||
};
|
||||
|
||||
} // namespace ix
|
||||
|
@ -5,7 +5,6 @@
|
||||
*/
|
||||
|
||||
#include "IXCobraMetricsPublisher.h"
|
||||
#include <ixwebsocket/IXSocketTLSOptions.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
@ -32,15 +31,14 @@ namespace ix
|
||||
const std::string& channel,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
bool enablePerMessageDeflate,
|
||||
const SocketTLSOptions& socketTLSOptions)
|
||||
bool enablePerMessageDeflate)
|
||||
{
|
||||
// Configure the satori connection and start its publish background thread
|
||||
_cobra_metrics_theaded_publisher.start();
|
||||
|
||||
_cobra_metrics_theaded_publisher.configure(appkey, endpoint, channel,
|
||||
rolename, rolesecret,
|
||||
enablePerMessageDeflate, socketTLSOptions);
|
||||
enablePerMessageDeflate);
|
||||
}
|
||||
|
||||
Json::Value& CobraMetricsPublisher::getGenericAttributes()
|
||||
|
@ -9,14 +9,12 @@
|
||||
#include "IXCobraMetricsThreadedPublisher.h"
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <json/json.h>
|
||||
#include <jsoncpp/json/json.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
struct SocketTLSOptions;
|
||||
|
||||
class CobraMetricsPublisher
|
||||
{
|
||||
public:
|
||||
@ -45,8 +43,7 @@ namespace ix
|
||||
const std::string& channel,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
bool enablePerMessageDeflate,
|
||||
const SocketTLSOptions& socketTLSOptions);
|
||||
bool enablePerMessageDeflate);
|
||||
|
||||
/// Setter for the list of blacklisted metrics ids.
|
||||
/// That list is sorted internally for fast lookups
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "IXCobraMetricsThreadedPublisher.h"
|
||||
#include <ixwebsocket/IXSetThreadName.h>
|
||||
#include <ixwebsocket/IXSocketTLSOptions.h>
|
||||
#include <ixcore/utils/IXCoreLogger.h>
|
||||
|
||||
#include <algorithm>
|
||||
@ -14,7 +13,6 @@
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace ix
|
||||
@ -65,10 +63,6 @@ namespace ix
|
||||
{
|
||||
ss << "Published message " << msgId << " acked";
|
||||
}
|
||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
||||
{
|
||||
ss << "Received websocket pong";
|
||||
}
|
||||
|
||||
ix::IXCoreLogger::Log(ss.str().c_str());
|
||||
});
|
||||
@ -97,17 +91,14 @@ namespace ix
|
||||
const std::string& channel,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
bool enablePerMessageDeflate,
|
||||
const SocketTLSOptions& socketTLSOptions)
|
||||
bool enablePerMessageDeflate)
|
||||
{
|
||||
_channel = channel;
|
||||
|
||||
ix::IXCoreLogger::Log(socketTLSOptions.getDescription().c_str());
|
||||
|
||||
ix::WebSocketPerMessageDeflateOptions webSocketPerMessageDeflateOptions(enablePerMessageDeflate);
|
||||
_cobra_connection.configure(appkey, endpoint,
|
||||
rolename, rolesecret,
|
||||
webSocketPerMessageDeflateOptions, socketTLSOptions);
|
||||
webSocketPerMessageDeflateOptions);
|
||||
}
|
||||
|
||||
void CobraMetricsThreadedPublisher::pushMessage(MessageKind messageKind)
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "IXCobraConnection.h"
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <json/json.h>
|
||||
#include <jsoncpp/json/json.h>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
@ -18,8 +18,6 @@
|
||||
|
||||
namespace ix
|
||||
{
|
||||
struct SocketTLSOptions;
|
||||
|
||||
class CobraMetricsThreadedPublisher
|
||||
{
|
||||
public:
|
||||
@ -32,8 +30,7 @@ namespace ix
|
||||
const std::string& channel,
|
||||
const std::string& rolename,
|
||||
const std::string& rolesecret,
|
||||
bool enablePerMessageDeflate,
|
||||
const SocketTLSOptions& socketTLSOptions);
|
||||
bool enablePerMessageDeflate);
|
||||
|
||||
/// Start the worker thread, used for background publishing
|
||||
void start();
|
||||
|
@ -16,15 +16,10 @@ add_library(ixsentry STATIC
|
||||
${IXSENTRY_HEADERS}
|
||||
)
|
||||
|
||||
find_package(JsonCpp)
|
||||
if (NOT JSONCPP_FOUND)
|
||||
set(JSONCPP_INCLUDE_DIRS ../third_party/jsoncpp)
|
||||
endif()
|
||||
|
||||
set(IXSENTRY_INCLUDE_DIRS
|
||||
.
|
||||
..
|
||||
../ixcore
|
||||
${JSONCPP_INCLUDE_DIRS})
|
||||
../third_party)
|
||||
|
||||
target_include_directories( ixsentry PUBLIC ${IXSENTRY_INCLUDE_DIRS} )
|
||||
|
@ -9,9 +9,7 @@
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <ixwebsocket/IXWebSocketHttpHeaders.h>
|
||||
#include <ixwebsocket/IXWebSocketVersion.h>
|
||||
#include <ixcore/utils/IXCoreLogger.h>
|
||||
|
||||
|
||||
@ -121,6 +119,26 @@ namespace ix
|
||||
{
|
||||
Json::Value payload;
|
||||
|
||||
payload["platform"] = "python";
|
||||
payload["sdk"]["name"] = "ws";
|
||||
payload["sdk"]["version"] = "1.0.0";
|
||||
payload["timestamp"] = SentryClient::getIso8601();
|
||||
|
||||
bool isNoisyTypes = msg["id"].asString() == "game_noisytypes_id";
|
||||
|
||||
std::string stackTraceFieldName = isNoisyTypes ? "traceback" : "stack";
|
||||
std::string stack(msg["data"][stackTraceFieldName].asString());
|
||||
|
||||
Json::Value exception;
|
||||
exception["stacktrace"]["frames"] = parseLuaStackTrace(stack);
|
||||
exception["value"] = isNoisyTypes ? parseExceptionName(stack) : msg["data"]["message"];
|
||||
|
||||
payload["exception"].append(exception);
|
||||
|
||||
Json::Value extra;
|
||||
extra["cobra_event"] = msg;
|
||||
extra["cobra_event"] = msg;
|
||||
|
||||
//
|
||||
// "tags": [
|
||||
// [
|
||||
@ -129,72 +147,8 @@ namespace ix
|
||||
// ],
|
||||
// ]
|
||||
//
|
||||
Json::Value tags(Json::arrayValue);
|
||||
Json::Value tags;
|
||||
|
||||
payload["platform"] = "python";
|
||||
payload["sdk"]["name"] = "ws";
|
||||
payload["sdk"]["version"] = IX_WEBSOCKET_VERSION;
|
||||
payload["timestamp"] = SentryClient::getIso8601();
|
||||
|
||||
bool isNoisyTypes = msg["id"].asString() == "game_noisytypes_id";
|
||||
|
||||
std::string stackTraceFieldName = isNoisyTypes ? "traceback" : "stack";
|
||||
std::string stack;
|
||||
std::string message;
|
||||
|
||||
if (isNoisyTypes)
|
||||
{
|
||||
stack = msg["data"][stackTraceFieldName].asString();
|
||||
message = parseExceptionName(stack);
|
||||
}
|
||||
else // logging
|
||||
{
|
||||
if (msg["data"].isMember("info"))
|
||||
{
|
||||
stack = msg["data"]["info"][stackTraceFieldName].asString();
|
||||
message = msg["data"]["info"]["message"].asString();
|
||||
|
||||
if (msg["data"].isMember("tags"))
|
||||
{
|
||||
auto members = msg["data"]["tags"].getMemberNames();
|
||||
|
||||
for (auto member : members)
|
||||
{
|
||||
Json::Value tag;
|
||||
tag.append(member);
|
||||
tag.append(msg["data"]["tags"][member]);
|
||||
tags.append(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (msg["data"]["info"].isMember("level_str"))
|
||||
{
|
||||
// https://docs.sentry.io/enriching-error-data/context/?platform=python#setting-the-level
|
||||
std::string level = msg["data"]["info"]["level_str"].asString();
|
||||
if (level == "critical")
|
||||
{
|
||||
level = "fatal";
|
||||
}
|
||||
payload["level"] = level;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stack = msg["data"][stackTraceFieldName].asString();
|
||||
message = msg["data"]["message"].asString();
|
||||
}
|
||||
}
|
||||
|
||||
Json::Value exception;
|
||||
exception["stacktrace"]["frames"] = parseLuaStackTrace(stack);
|
||||
exception["value"] = message;
|
||||
|
||||
payload["exception"].append(exception);
|
||||
|
||||
Json::Value extra;
|
||||
extra["cobra_event"] = msg;
|
||||
|
||||
// Builtin tags
|
||||
Json::Value gameTag;
|
||||
gameTag.append("game");
|
||||
gameTag.append(msg["device"]["game"]);
|
||||
@ -210,11 +164,6 @@ namespace ix
|
||||
environmentTag.append(msg["device"]["environment"]);
|
||||
tags.append(environmentTag);
|
||||
|
||||
Json::Value clientVersionTag;
|
||||
clientVersionTag.append("client_version");
|
||||
clientVersionTag.append(msg["device"]["app_version"]);
|
||||
tags.append(clientVersionTag);
|
||||
|
||||
payload["tags"] = tags;
|
||||
|
||||
return _jsonWriter.write(payload);
|
||||
@ -279,6 +228,7 @@ namespace ix
|
||||
args->url = computeUrl(project, key);
|
||||
args->body = _httpClient->serializeHttpFormDataParameters(multipartBoundary, httpFormDataParameters, httpParameters);
|
||||
|
||||
|
||||
_httpClient->performRequest(args, onResponseCallback);
|
||||
}
|
||||
} // namespace ix
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <ixwebsocket/IXHttpClient.h>
|
||||
#include <json/json.h>
|
||||
#include <jsoncpp/json/json.h>
|
||||
#include <regex>
|
||||
#include <memory>
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ixwebsocket/IXSocketTLSOptions.h>
|
||||
|
||||
namespace snake
|
||||
{
|
||||
@ -27,12 +26,8 @@ namespace snake
|
||||
// AppKeys
|
||||
nlohmann::json apps;
|
||||
|
||||
// TLS options
|
||||
ix::SocketTLSOptions socketTLSOptions;
|
||||
|
||||
// Misc
|
||||
bool verbose;
|
||||
bool disablePong;
|
||||
};
|
||||
|
||||
bool isAppKeyValid(const AppConfig& appConfig, std::string appkey);
|
||||
|
@ -29,13 +29,8 @@ namespace ix
|
||||
return false;
|
||||
}
|
||||
|
||||
CancellationRequest cancellationRequest = []() -> bool
|
||||
{
|
||||
return false;
|
||||
};
|
||||
|
||||
std::string errMsg;
|
||||
return _socket->connect(hostname, port, errMsg, cancellationRequest);
|
||||
return _socket->connect(hostname, port, errMsg, nullptr);
|
||||
}
|
||||
|
||||
void RedisClient::stop()
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
namespace ix
|
||||
{
|
||||
RedisServer::RedisServer(int port, const std::string& host, int backlog, size_t maxConnections, int addressFamily)
|
||||
: SocketServer(port, host, backlog, maxConnections, addressFamily)
|
||||
RedisServer::RedisServer(int port, const std::string& host, int backlog, size_t maxConnections)
|
||||
: SocketServer(port, host, backlog, maxConnections)
|
||||
, _connectedClientsCount(0)
|
||||
, _stopHandlingConnections(false)
|
||||
{
|
||||
|
@ -25,8 +25,7 @@ namespace ix
|
||||
RedisServer(int port = SocketServer::kDefaultPort,
|
||||
const std::string& host = SocketServer::kDefaultHost,
|
||||
int backlog = SocketServer::kDefaultTcpBacklog,
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections,
|
||||
int addressFamily = SocketServer::kDefaultAddressFamily);
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections);
|
||||
virtual ~RedisServer();
|
||||
virtual void stop() final;
|
||||
|
||||
|
@ -20,16 +20,7 @@ namespace snake
|
||||
: _appConfig(appConfig)
|
||||
, _server(appConfig.port, appConfig.hostname)
|
||||
{
|
||||
_server.setTLSOptions(appConfig.socketTLSOptions);
|
||||
|
||||
if (appConfig.disablePong)
|
||||
{
|
||||
_server.disablePong();
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Listening on " << appConfig.hostname << ":" << appConfig.port;
|
||||
ix::IXCoreLogger::Log(ss.str().c_str());
|
||||
;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -61,7 +61,7 @@ namespace ix
|
||||
errMsg = "no error";
|
||||
|
||||
// Maybe a cancellation request got in before the background thread terminated ?
|
||||
if (isCancellationRequested())
|
||||
if (isCancellationRequested && isCancellationRequested())
|
||||
{
|
||||
errMsg = "cancellation requested";
|
||||
return nullptr;
|
||||
@ -107,7 +107,7 @@ namespace ix
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(_wait));
|
||||
|
||||
// Were we cancelled ?
|
||||
if (isCancellationRequested())
|
||||
if (isCancellationRequested && isCancellationRequested())
|
||||
{
|
||||
errMsg = "cancellation requested";
|
||||
return nullptr;
|
||||
@ -115,7 +115,7 @@ namespace ix
|
||||
}
|
||||
|
||||
// Maybe a cancellation request got in before the bg terminated ?
|
||||
if (isCancellationRequested())
|
||||
if (isCancellationRequested && isCancellationRequested())
|
||||
{
|
||||
errMsg = "cancellation requested";
|
||||
return nullptr;
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "IXProgressCallback.h"
|
||||
#include "IXWebSocketHttpHeaders.h"
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
@ -66,8 +65,8 @@ namespace ix
|
||||
};
|
||||
|
||||
using HttpResponsePtr = std::shared_ptr<HttpResponse>;
|
||||
using HttpParameters = std::unordered_map<std::string, std::string>;
|
||||
using HttpFormDataParameters = std::unordered_map<std::string, std::string>;
|
||||
using HttpParameters = std::map<std::string, std::string>;
|
||||
using HttpFormDataParameters = std::map<std::string, std::string>;
|
||||
using Logger = std::function<void(const std::string&)>;
|
||||
using OnResponseCallback = std::function<void(const HttpResponsePtr&)>;
|
||||
|
||||
|
@ -648,7 +648,7 @@ namespace ix
|
||||
<< it.second << "\r\n";
|
||||
}
|
||||
|
||||
ss << "--" << multipartBoundary << "--\r\n";
|
||||
ss << "--" << multipartBoundary << "\r\n";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "IXSocketConnect.h"
|
||||
#include "IXUserAgent.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
@ -42,9 +43,8 @@ namespace
|
||||
|
||||
namespace ix
|
||||
{
|
||||
HttpServer::HttpServer(
|
||||
int port, const std::string& host, int backlog, size_t maxConnections, int addressFamily)
|
||||
: SocketServer(port, host, backlog, maxConnections, addressFamily)
|
||||
HttpServer::HttpServer(int port, const std::string& host, int backlog, size_t maxConnections)
|
||||
: SocketServer(port, host, backlog, maxConnections)
|
||||
, _connectedClientsCount(0)
|
||||
{
|
||||
setDefaultConnectionCallback();
|
||||
|
@ -28,8 +28,7 @@ namespace ix
|
||||
HttpServer(int port = SocketServer::kDefaultPort,
|
||||
const std::string& host = SocketServer::kDefaultHost,
|
||||
int backlog = SocketServer::kDefaultTcpBacklog,
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections,
|
||||
int addressFamily = SocketServer::kDefaultAddressFamily);
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections);
|
||||
virtual ~HttpServer();
|
||||
virtual void stop() final;
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include "IXSelectInterruptFactory.h"
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#include "IXSelectInterruptPipe.h"
|
||||
#include <ixwebsocket/IXSelectInterruptPipe.h>
|
||||
#else
|
||||
#include "IXSelectInterrupt.h"
|
||||
#include <ixwebsocket/IXSelectInterrupt.h>
|
||||
#endif
|
||||
|
||||
namespace ix
|
||||
|
@ -54,17 +54,14 @@ namespace ix
|
||||
// to ::poll does fix that.
|
||||
//
|
||||
// However poll isn't as portable as select and has bugs on Windows, so we
|
||||
// have a shim to fallback to select on those platforms. See
|
||||
// should write a shim to fallback to select on those platforms. See
|
||||
// https://github.com/mpv-player/mpv/pull/5203/files for such a select wrapper.
|
||||
//
|
||||
nfds_t nfds = 1;
|
||||
struct pollfd fds[2];
|
||||
memset(fds, 0, sizeof(fds));
|
||||
|
||||
fds[0].fd = sockfd;
|
||||
fds[0].events = (readyToRead) ? POLLIN : POLLOUT;
|
||||
|
||||
// this is ignored by poll, but our select based poll wrapper on Windows needs it
|
||||
fds[0].events |= POLLERR;
|
||||
|
||||
// File descriptor used to interrupt select when needed
|
||||
@ -135,11 +132,6 @@ namespace ix
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (sockfd != -1 && (fds[0].revents & POLLERR || fds[0].revents & POLLHUP ||
|
||||
fds[0].revents & POLLNVAL))
|
||||
{
|
||||
pollResult = PollResultType::Error;
|
||||
}
|
||||
|
||||
return pollResult;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ namespace ix
|
||||
virtual void close();
|
||||
|
||||
virtual ssize_t send(char* buffer, size_t length);
|
||||
ssize_t send(const std::string& buffer);
|
||||
virtual ssize_t send(const std::string& buffer);
|
||||
virtual ssize_t recv(void* buffer, size_t length);
|
||||
|
||||
// Blocking and cancellable versions, working with socket that can be set
|
||||
|
@ -24,47 +24,9 @@
|
||||
|
||||
#include <Security/SecureTransport.h>
|
||||
|
||||
namespace ix
|
||||
namespace
|
||||
{
|
||||
SocketAppleSSL::SocketAppleSSL(const SocketTLSOptions& tlsOptions, int fd)
|
||||
: Socket(fd)
|
||||
, _sslContext(nullptr)
|
||||
, _tlsOptions(tlsOptions)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
SocketAppleSSL::~SocketAppleSSL()
|
||||
{
|
||||
SocketAppleSSL::close();
|
||||
}
|
||||
|
||||
std::string SocketAppleSSL::getSSLErrorDescription(OSStatus status)
|
||||
{
|
||||
std::string errMsg("Unknown SSL error.");
|
||||
|
||||
CFErrorRef error = CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainOSStatus, status, NULL);
|
||||
if (error)
|
||||
{
|
||||
CFStringRef message = CFErrorCopyDescription(error);
|
||||
if (message)
|
||||
{
|
||||
char localBuffer[128];
|
||||
Boolean success;
|
||||
success = CFStringGetCString(message, localBuffer, 128, kCFStringEncodingUTF8);
|
||||
if (success)
|
||||
{
|
||||
errMsg = localBuffer;
|
||||
}
|
||||
CFRelease(message);
|
||||
}
|
||||
CFRelease(error);
|
||||
}
|
||||
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
OSStatus SocketAppleSSL::readFromSocket(SSLConnectionRef connection, void* data, size_t* len)
|
||||
OSStatus read_from_socket(SSLConnectionRef connection, void* data, size_t* len)
|
||||
{
|
||||
int fd = (int) (long) connection;
|
||||
if (fd < 0) return errSSLInternal;
|
||||
@ -80,15 +42,11 @@ namespace ix
|
||||
{
|
||||
*len = (size_t) status;
|
||||
if (requested_sz > *len)
|
||||
{
|
||||
return errSSLWouldBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
return noErr;
|
||||
}
|
||||
}
|
||||
else if (status == 0)
|
||||
else if (0 == status)
|
||||
{
|
||||
*len = 0;
|
||||
return errSSLClosedGraceful;
|
||||
@ -100,8 +58,7 @@ namespace ix
|
||||
{
|
||||
case ENOENT: return errSSLClosedGraceful;
|
||||
|
||||
case EAGAIN: return errSSLWouldBlock; // EWOULDBLOCK is a define for EAGAIN on osx
|
||||
case EINPROGRESS: return errSSLWouldBlock;
|
||||
case EAGAIN: return errSSLWouldBlock;
|
||||
|
||||
case ECONNRESET: return errSSLClosedAbort;
|
||||
|
||||
@ -110,9 +67,7 @@ namespace ix
|
||||
}
|
||||
}
|
||||
|
||||
OSStatus SocketAppleSSL::writeToSocket(SSLConnectionRef connection,
|
||||
const void* data,
|
||||
size_t* len)
|
||||
OSStatus write_to_socket(SSLConnectionRef connection, const void* data, size_t* len)
|
||||
{
|
||||
int fd = (int) (long) connection;
|
||||
if (fd < 0) return errSSLInternal;
|
||||
@ -127,15 +82,11 @@ namespace ix
|
||||
{
|
||||
*len = (size_t) status;
|
||||
if (to_write_sz > *len)
|
||||
{
|
||||
return errSSLWouldBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
return noErr;
|
||||
}
|
||||
}
|
||||
else if (status == 0)
|
||||
else if (0 == status)
|
||||
{
|
||||
*len = 0;
|
||||
return errSSLClosedGraceful;
|
||||
@ -143,25 +94,58 @@ namespace ix
|
||||
else
|
||||
{
|
||||
*len = 0;
|
||||
switch (errno)
|
||||
if (EAGAIN == errno)
|
||||
{
|
||||
case ENOENT: return errSSLClosedGraceful;
|
||||
|
||||
case EAGAIN: return errSSLWouldBlock; // EWOULDBLOCK is a define for EAGAIN on osx
|
||||
case EINPROGRESS: return errSSLWouldBlock;
|
||||
|
||||
case ECONNRESET: return errSSLClosedAbort;
|
||||
|
||||
default: return errSecIO;
|
||||
return errSSLWouldBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
return errSecIO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SocketAppleSSL::accept(std::string& errMsg)
|
||||
std::string getSSLErrorDescription(OSStatus status)
|
||||
{
|
||||
errMsg = "TLS not supported yet in server mode with apple ssl backend";
|
||||
return false;
|
||||
std::string errMsg("Unknown SSL error.");
|
||||
|
||||
CFErrorRef error = CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainOSStatus, status, NULL);
|
||||
if (error)
|
||||
{
|
||||
CFStringRef message = CFErrorCopyDescription(error);
|
||||
if (message)
|
||||
{
|
||||
char localBuffer[128];
|
||||
Boolean success;
|
||||
success =
|
||||
CFStringGetCString(message, localBuffer, 128, CFStringGetSystemEncoding());
|
||||
if (success)
|
||||
{
|
||||
errMsg = localBuffer;
|
||||
}
|
||||
CFRelease(message);
|
||||
}
|
||||
CFRelease(error);
|
||||
}
|
||||
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace ix
|
||||
{
|
||||
SocketAppleSSL::SocketAppleSSL(const SocketTLSOptions& tlsOptions, int fd)
|
||||
: Socket(fd)
|
||||
, _sslContext(nullptr)
|
||||
, _tlsOptions(tlsOptions)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
SocketAppleSSL::~SocketAppleSSL()
|
||||
{
|
||||
SocketAppleSSL::close();
|
||||
}
|
||||
|
||||
// No wait support
|
||||
@ -179,8 +163,7 @@ namespace ix
|
||||
|
||||
_sslContext = SSLCreateContext(kCFAllocatorDefault, kSSLClientSide, kSSLStreamType);
|
||||
|
||||
SSLSetIOFuncs(
|
||||
_sslContext, SocketAppleSSL::readFromSocket, SocketAppleSSL::writeToSocket);
|
||||
SSLSetIOFuncs(_sslContext, read_from_socket, write_to_socket);
|
||||
SSLSetConnection(_sslContext, (SSLConnectionRef)(long) _sockfd);
|
||||
SSLSetProtocolVersionMin(_sslContext, kTLSProtocol12);
|
||||
SSLSetPeerDomainName(_sslContext, host.c_str(), host.size());
|
||||
@ -193,7 +176,7 @@ namespace ix
|
||||
do
|
||||
{
|
||||
status = SSLHandshake(_sslContext);
|
||||
} while (status == errSSLWouldBlock || status == errSSLServerAuthCompleted);
|
||||
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||
|
||||
if (status == errSSLServerAuthCompleted)
|
||||
{
|
||||
@ -201,7 +184,7 @@ namespace ix
|
||||
do
|
||||
{
|
||||
status = SSLHandshake(_sslContext);
|
||||
} while (status == errSSLWouldBlock || status == errSSLServerAuthCompleted);
|
||||
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -209,11 +192,11 @@ namespace ix
|
||||
do
|
||||
{
|
||||
status = SSLHandshake(_sslContext);
|
||||
} while (status == errSSLWouldBlock || status == errSSLServerAuthCompleted);
|
||||
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||
}
|
||||
}
|
||||
|
||||
if (status != noErr)
|
||||
if (noErr != status)
|
||||
{
|
||||
errMsg = getSSLErrorDescription(status);
|
||||
close();
|
||||
@ -238,38 +221,32 @@ namespace ix
|
||||
|
||||
ssize_t SocketAppleSSL::send(char* buf, size_t nbyte)
|
||||
{
|
||||
OSStatus status = errSSLWouldBlock;
|
||||
while (status == errSSLWouldBlock)
|
||||
ssize_t ret = 0;
|
||||
OSStatus status;
|
||||
do
|
||||
{
|
||||
size_t processed = 0;
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
status = SSLWrite(_sslContext, buf, nbyte, &processed);
|
||||
ret += processed;
|
||||
buf += processed;
|
||||
nbyte -= processed;
|
||||
} while (nbyte > 0 && errSSLWouldBlock == status);
|
||||
|
||||
if (processed > 0) return (ssize_t) processed;
|
||||
if (ret == 0 && errSSLClosedAbort != status) ret = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// The connection was reset, inform the caller that this
|
||||
// Socket should close
|
||||
if (status == errSSLClosedGraceful || status == errSSLClosedNoNotify ||
|
||||
status == errSSLClosedAbort)
|
||||
{
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (status == errSSLWouldBlock)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
ssize_t SocketAppleSSL::send(const std::string& buffer)
|
||||
{
|
||||
return send((char*) &buffer[0], buffer.size());
|
||||
}
|
||||
|
||||
// No wait support
|
||||
ssize_t SocketAppleSSL::recv(void* buf, size_t nbyte)
|
||||
{
|
||||
OSStatus status = errSSLWouldBlock;
|
||||
while (status == errSSLWouldBlock)
|
||||
while (errSSLWouldBlock == status)
|
||||
{
|
||||
size_t processed = 0;
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
@ -21,8 +21,6 @@ namespace ix
|
||||
SocketAppleSSL(const SocketTLSOptions& tlsOptions, int fd = -1);
|
||||
~SocketAppleSSL();
|
||||
|
||||
virtual bool accept(std::string& errMsg) final;
|
||||
|
||||
virtual bool connect(const std::string& host,
|
||||
int port,
|
||||
std::string& errMsg,
|
||||
@ -30,13 +28,10 @@ namespace ix
|
||||
virtual void close() final;
|
||||
|
||||
virtual ssize_t send(char* buffer, size_t length) final;
|
||||
virtual ssize_t send(const std::string& buffer) final;
|
||||
virtual ssize_t recv(void* buffer, size_t length) final;
|
||||
|
||||
private:
|
||||
static std::string getSSLErrorDescription(OSStatus status);
|
||||
static OSStatus writeToSocket(SSLConnectionRef connection, const void* data, size_t* len);
|
||||
static OSStatus readFromSocket(SSLConnectionRef connection, void* data, size_t* len);
|
||||
|
||||
SSLContextRef _sslContext;
|
||||
mutable std::mutex _mutex; // AppleSSL routines are not thread-safe
|
||||
|
||||
|
@ -9,16 +9,18 @@
|
||||
#ifdef IXWEBSOCKET_USE_TLS
|
||||
|
||||
#ifdef IXWEBSOCKET_USE_MBED_TLS
|
||||
#include "IXSocketMbedTLS.h"
|
||||
#include <ixwebsocket/IXSocketMbedTLS.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <ixwebsocket/IXSocketSChannel.h>
|
||||
#elif defined(IXWEBSOCKET_USE_OPEN_SSL)
|
||||
#include "IXSocketOpenSSL.h"
|
||||
#include <ixwebsocket/IXSocketOpenSSL.h>
|
||||
#elif __APPLE__
|
||||
#include "IXSocketAppleSSL.h"
|
||||
#include <ixwebsocket/IXSocketAppleSSL.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include "IXSocket.h"
|
||||
#include <ixwebsocket/IXSocket.h>
|
||||
|
||||
#endif
|
||||
|
||||
@ -44,6 +46,8 @@ namespace ix
|
||||
socket = std::make_shared<SocketMbedTLS>(tlsOptions, fd);
|
||||
#elif defined(IXWEBSOCKET_USE_OPEN_SSL)
|
||||
socket = std::make_shared<SocketOpenSSL>(tlsOptions, fd);
|
||||
#elif defined(_WIN32)
|
||||
socket = std::make_shared<SocketSChannel>(tlsOptions, fd);
|
||||
#elif defined(__APPLE__)
|
||||
socket = std::make_shared<SocketAppleSSL>(tlsOptions, fd);
|
||||
#endif
|
||||
|
@ -38,11 +38,9 @@ namespace ix
|
||||
mbedtls_ctr_drbg_init(&_ctr_drbg);
|
||||
mbedtls_entropy_init(&_entropy);
|
||||
mbedtls_x509_crt_init(&_cacert);
|
||||
mbedtls_x509_crt_init(&_cert);
|
||||
mbedtls_pk_init(&_pkey);
|
||||
}
|
||||
|
||||
bool SocketMbedTLS::init(const std::string& host, bool isClient, std::string& errMsg)
|
||||
bool SocketMbedTLS::init(const std::string& host, std::string& errMsg)
|
||||
{
|
||||
initMBedTLS();
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
@ -60,7 +58,7 @@ namespace ix
|
||||
}
|
||||
|
||||
if (mbedtls_ssl_config_defaults(&_conf,
|
||||
(isClient) ? MBEDTLS_SSL_IS_CLIENT : MBEDTLS_SSL_IS_SERVER,
|
||||
MBEDTLS_SSL_IS_CLIENT,
|
||||
MBEDTLS_SSL_TRANSPORT_STREAM,
|
||||
MBEDTLS_SSL_PRESET_DEFAULT) != 0)
|
||||
{
|
||||
@ -70,32 +68,13 @@ namespace ix
|
||||
|
||||
mbedtls_ssl_conf_rng(&_conf, mbedtls_ctr_drbg_random, &_ctr_drbg);
|
||||
|
||||
if (_tlsOptions.hasCertAndKey())
|
||||
{
|
||||
if (mbedtls_x509_crt_parse_file(&_cert, _tlsOptions.certFile.c_str()) < 0)
|
||||
{
|
||||
errMsg = "Cannot parse cert file '" + _tlsOptions.certFile + "'";
|
||||
return false;
|
||||
}
|
||||
if (mbedtls_pk_parse_keyfile(&_pkey, _tlsOptions.keyFile.c_str(), "") < 0)
|
||||
{
|
||||
errMsg = "Cannot parse key file '" + _tlsOptions.keyFile + "'";
|
||||
return false;
|
||||
}
|
||||
if (mbedtls_ssl_conf_own_cert(&_conf, &_cert, &_pkey) < 0)
|
||||
{
|
||||
errMsg = "Problem configuring cert '" + _tlsOptions.certFile + "'";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (_tlsOptions.isPeerVerifyDisabled())
|
||||
{
|
||||
mbedtls_ssl_conf_authmode(&_conf, MBEDTLS_SSL_VERIFY_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
mbedtls_ssl_conf_authmode(&_conf, MBEDTLS_SSL_VERIFY_REQUIRED);
|
||||
mbedtls_ssl_conf_ca_chain(&_conf, &_cacert, NULL);
|
||||
|
||||
// FIXME: should we call mbedtls_ssl_conf_verify ?
|
||||
|
||||
@ -108,8 +87,7 @@ namespace ix
|
||||
errMsg = "Cannot parse CA file '" + _tlsOptions.caFile + "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
mbedtls_ssl_conf_ca_chain(&_conf, &_cacert, NULL);
|
||||
mbedtls_ssl_conf_authmode(&_conf, MBEDTLS_SSL_VERIFY_REQUIRED);
|
||||
}
|
||||
|
||||
if (mbedtls_ssl_setup(&_ssl, &_conf) != 0)
|
||||
@ -118,7 +96,7 @@ namespace ix
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!host.empty() && mbedtls_ssl_set_hostname(&_ssl, host.c_str()) != 0)
|
||||
if (mbedtls_ssl_set_hostname(&_ssl, host.c_str()) != 0)
|
||||
{
|
||||
errMsg = "SNI setup failed";
|
||||
return false;
|
||||
@ -127,50 +105,6 @@ namespace ix
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SocketMbedTLS::accept(std::string& errMsg)
|
||||
{
|
||||
bool isClient = false;
|
||||
bool initialized = init(std::string(), isClient, errMsg);
|
||||
if (!initialized)
|
||||
{
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
mbedtls_ssl_set_bio(&_ssl, &_sockfd, mbedtls_net_send, mbedtls_net_recv, NULL);
|
||||
|
||||
int res;
|
||||
do
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
res = mbedtls_ssl_handshake(&_ssl);
|
||||
} while (res == MBEDTLS_ERR_SSL_WANT_READ || res == MBEDTLS_ERR_SSL_WANT_WRITE);
|
||||
|
||||
if (res != 0)
|
||||
{
|
||||
char buf[256];
|
||||
mbedtls_strerror(res, buf, sizeof(buf));
|
||||
|
||||
errMsg = "error in handshake : ";
|
||||
errMsg += buf;
|
||||
|
||||
if (res == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED)
|
||||
{
|
||||
char verifyBuf[512];
|
||||
uint32_t flags = mbedtls_ssl_get_verify_result(&_ssl);
|
||||
|
||||
mbedtls_x509_crt_verify_info(verifyBuf, sizeof(verifyBuf), " ! ", flags);
|
||||
errMsg += " : ";
|
||||
errMsg += verifyBuf;
|
||||
}
|
||||
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SocketMbedTLS::connect(const std::string& host,
|
||||
int port,
|
||||
std::string& errMsg,
|
||||
@ -182,8 +116,7 @@ namespace ix
|
||||
if (_sockfd == -1) return false;
|
||||
}
|
||||
|
||||
bool isClient = true;
|
||||
bool initialized = init(host, isClient, errMsg);
|
||||
bool initialized = init(host, errMsg);
|
||||
if (!initialized)
|
||||
{
|
||||
close();
|
||||
@ -223,30 +156,41 @@ namespace ix
|
||||
mbedtls_ctr_drbg_free(&_ctr_drbg);
|
||||
mbedtls_entropy_free(&_entropy);
|
||||
mbedtls_x509_crt_free(&_cacert);
|
||||
mbedtls_x509_crt_free(&_cert);
|
||||
|
||||
Socket::close();
|
||||
}
|
||||
|
||||
ssize_t SocketMbedTLS::send(char* buf, size_t nbyte)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
ssize_t sent = 0;
|
||||
|
||||
ssize_t res = mbedtls_ssl_write(&_ssl, (unsigned char*) buf, nbyte);
|
||||
while (nbyte > 0)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
else if (res == MBEDTLS_ERR_SSL_WANT_READ || res == MBEDTLS_ERR_SSL_WANT_WRITE)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
ssize_t res = mbedtls_ssl_write(&_ssl, (unsigned char*) buf, nbyte);
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
nbyte -= res;
|
||||
sent += res;
|
||||
}
|
||||
else if (res == MBEDTLS_ERR_SSL_WANT_READ || res == MBEDTLS_ERR_SSL_WANT_WRITE)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return sent;
|
||||
}
|
||||
|
||||
ssize_t SocketMbedTLS::send(const std::string& buffer)
|
||||
{
|
||||
return send((char*) &buffer[0], buffer.size());
|
||||
}
|
||||
|
||||
ssize_t SocketMbedTLS::recv(void* buf, size_t nbyte)
|
||||
|
@ -26,8 +26,6 @@ namespace ix
|
||||
SocketMbedTLS(const SocketTLSOptions& tlsOptions, int fd = -1);
|
||||
~SocketMbedTLS();
|
||||
|
||||
virtual bool accept(std::string& errMsg) final;
|
||||
|
||||
virtual bool connect(const std::string& host,
|
||||
int port,
|
||||
std::string& errMsg,
|
||||
@ -35,6 +33,7 @@ namespace ix
|
||||
virtual void close() final;
|
||||
|
||||
virtual ssize_t send(char* buffer, size_t length) final;
|
||||
virtual ssize_t send(const std::string& buffer) final;
|
||||
virtual ssize_t recv(void* buffer, size_t length) final;
|
||||
|
||||
private:
|
||||
@ -43,13 +42,11 @@ namespace ix
|
||||
mbedtls_entropy_context _entropy;
|
||||
mbedtls_ctr_drbg_context _ctr_drbg;
|
||||
mbedtls_x509_crt _cacert;
|
||||
mbedtls_x509_crt _cert;
|
||||
mbedtls_pk_context _pkey;
|
||||
|
||||
std::mutex _mutex;
|
||||
SocketTLSOptions _tlsOptions;
|
||||
|
||||
bool init(const std::string& host, bool isClient, std::string& errMsg);
|
||||
bool init(const std::string& host, std::string& errMsg);
|
||||
void initMBedTLS();
|
||||
};
|
||||
|
||||
|
@ -11,14 +11,8 @@
|
||||
#include "IXSocketConnect.h"
|
||||
#include <cassert>
|
||||
#include <errno.h>
|
||||
#ifdef _WIN32
|
||||
#include <Shlwapi.h>
|
||||
#else
|
||||
#include <fnmatch.h>
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
#include <openssl/x509v3.h>
|
||||
#endif
|
||||
#define socketerrno errno
|
||||
|
||||
namespace ix
|
||||
@ -142,11 +136,7 @@ namespace ix
|
||||
*/
|
||||
bool SocketOpenSSL::checkHost(const std::string& host, const char* pattern)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return PathMatchSpecA(host.c_str(), pattern);
|
||||
#else
|
||||
return fnmatch(pattern, host.c_str(), 0) != FNM_NOMATCH;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SocketOpenSSL::openSSLCheckServerCert(SSL* ssl,
|
||||
@ -603,30 +593,42 @@ namespace ix
|
||||
|
||||
ssize_t SocketOpenSSL::send(char* buf, size_t nbyte)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
ssize_t sent = 0;
|
||||
|
||||
if (_ssl_connection == nullptr || _ssl_context == nullptr)
|
||||
while (nbyte > 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
||||
ERR_clear_error();
|
||||
ssize_t write_result = SSL_write(_ssl_connection, buf, (int) nbyte);
|
||||
int reason = SSL_get_error(_ssl_connection, (int) write_result);
|
||||
if (_ssl_connection == nullptr || _ssl_context == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (reason == SSL_ERROR_NONE)
|
||||
{
|
||||
return write_result;
|
||||
}
|
||||
else if (reason == SSL_ERROR_WANT_READ || reason == SSL_ERROR_WANT_WRITE)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
ERR_clear_error();
|
||||
ssize_t write_result = SSL_write(_ssl_connection, buf + sent, (int) nbyte);
|
||||
int reason = SSL_get_error(_ssl_connection, (int) write_result);
|
||||
|
||||
if (reason == SSL_ERROR_NONE)
|
||||
{
|
||||
nbyte -= write_result;
|
||||
sent += write_result;
|
||||
}
|
||||
else if (reason == SSL_ERROR_WANT_READ || reason == SSL_ERROR_WANT_WRITE)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return sent;
|
||||
}
|
||||
|
||||
ssize_t SocketOpenSSL::send(const std::string& buffer)
|
||||
{
|
||||
return send((char*) &buffer[0], buffer.size());
|
||||
}
|
||||
|
||||
ssize_t SocketOpenSSL::recv(void* buf, size_t nbyte)
|
||||
|
@ -33,6 +33,7 @@ namespace ix
|
||||
virtual void close() final;
|
||||
|
||||
virtual ssize_t send(char* buffer, size_t length) final;
|
||||
virtual ssize_t send(const std::string& buffer) final;
|
||||
virtual ssize_t recv(void* buffer, size_t length) final;
|
||||
|
||||
private:
|
||||
|
100
ixwebsocket/IXSocketSChannel.cpp
Normal file
100
ixwebsocket/IXSocketSChannel.cpp
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* IXSocketSChannel.cpp
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
|
||||
*
|
||||
* See https://docs.microsoft.com/en-us/windows/desktop/WinSock/using-secure-socket-extensions
|
||||
*
|
||||
* https://github.com/pauldotknopf/WindowsSDK7-Samples/blob/master/netds/winsock/securesocket/stcpclient/tcpclient.c
|
||||
*
|
||||
* This is the right example to look at:
|
||||
* https://www.codeproject.com/Articles/1000189/A-Working-TCP-Client-and-Server-With-SSL
|
||||
*/
|
||||
#include "IXSocketSChannel.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WS2tcpip.h>
|
||||
#include <WinSock2.h>
|
||||
#include <basetsd.h>
|
||||
#include <io.h>
|
||||
#include <schannel.h>
|
||||
#include <ws2def.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#ifndef UNICODE
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
#include <mstcpip.h>
|
||||
#include <ntdsapi.h>
|
||||
#include <rpc.h>
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define RECV_DATA_BUF_SIZE 256
|
||||
|
||||
// Link with ws2_32.lib
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
|
||||
// link with fwpuclnt.lib for Winsock secure socket extensions
|
||||
#pragma comment(lib, "fwpuclnt.lib")
|
||||
|
||||
// link with ntdsapi.lib for DsMakeSpn function
|
||||
#pragma comment(lib, "ntdsapi.lib")
|
||||
|
||||
// The following function assumes that Winsock
|
||||
// has already been initialized
|
||||
|
||||
|
||||
#else
|
||||
#error("This file should only be built on Windows")
|
||||
#endif
|
||||
|
||||
namespace ix
|
||||
{
|
||||
SocketSChannel::SocketSChannel()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
SocketSChannel::~SocketSChannel()
|
||||
{
|
||||
}
|
||||
|
||||
bool SocketSChannel::connect(const std::string& host, int port, std::string& errMsg)
|
||||
{
|
||||
return Socket::connect(host, port, errMsg, nullptr);
|
||||
}
|
||||
|
||||
|
||||
void SocketSChannel::secureSocket()
|
||||
{
|
||||
// there will be a lot to do here ...
|
||||
}
|
||||
|
||||
void SocketSChannel::close()
|
||||
{
|
||||
Socket::close();
|
||||
}
|
||||
|
||||
ssize_t SocketSChannel::send(char* buf, size_t nbyte)
|
||||
{
|
||||
return Socket::send(buf, nbyte);
|
||||
}
|
||||
|
||||
ssize_t SocketSChannel::send(const std::string& buffer)
|
||||
{
|
||||
return Socket::send(buffer);
|
||||
}
|
||||
|
||||
ssize_t SocketSChannel::recv(void* buf, size_t nbyte)
|
||||
{
|
||||
return Socket::recv(buf, nbyte);
|
||||
}
|
||||
|
||||
} // namespace ix
|
32
ixwebsocket/IXSocketSChannel.h
Normal file
32
ixwebsocket/IXSocketSChannel.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* IXSocketSChannel.h
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2017-2018 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IXSocket.h"
|
||||
|
||||
namespace ix
|
||||
{
|
||||
class SocketSChannel final : public Socket
|
||||
{
|
||||
public:
|
||||
SocketSChannel();
|
||||
~SocketSChannel();
|
||||
|
||||
virtual bool connect(const std::string& host, int port, std::string& errMsg) final;
|
||||
virtual void close() final;
|
||||
|
||||
// The important override
|
||||
virtual void secureSocket() final;
|
||||
|
||||
virtual ssize_t send(char* buffer, size_t length) final;
|
||||
virtual ssize_t send(const std::string& buffer) final;
|
||||
virtual ssize_t recv(void* buffer, size_t length) final;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
} // namespace ix
|
@ -11,8 +11,8 @@
|
||||
#include "IXSocketConnect.h"
|
||||
#include "IXSocketFactory.h"
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
namespace ix
|
||||
@ -21,15 +21,15 @@ namespace ix
|
||||
const std::string SocketServer::kDefaultHost("127.0.0.1");
|
||||
const int SocketServer::kDefaultTcpBacklog(5);
|
||||
const size_t SocketServer::kDefaultMaxConnections(32);
|
||||
const int SocketServer::kDefaultAddressFamily(AF_INET);
|
||||
|
||||
SocketServer::SocketServer(
|
||||
int port, const std::string& host, int backlog, size_t maxConnections, int addressFamily)
|
||||
SocketServer::SocketServer(int port,
|
||||
const std::string& host,
|
||||
int backlog,
|
||||
size_t maxConnections)
|
||||
: _port(port)
|
||||
, _host(host)
|
||||
, _backlog(backlog)
|
||||
, _maxConnections(maxConnections)
|
||||
, _addressFamily(addressFamily)
|
||||
, _serverFd(-1)
|
||||
, _stop(false)
|
||||
, _stopGc(false)
|
||||
@ -45,26 +45,21 @@ namespace ix
|
||||
void SocketServer::logError(const std::string& str)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_logMutex);
|
||||
fprintf(stderr, "%s\n", str.c_str());
|
||||
std::cerr << str << std::endl;
|
||||
}
|
||||
|
||||
void SocketServer::logInfo(const std::string& str)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_logMutex);
|
||||
fprintf(stdout, "%s\n", str.c_str());
|
||||
std::cout << str << std::endl;
|
||||
}
|
||||
|
||||
std::pair<bool, std::string> SocketServer::listen()
|
||||
{
|
||||
if (_addressFamily != AF_INET && _addressFamily != AF_INET6)
|
||||
{
|
||||
std::string errMsg("SocketServer::listen() AF_INET and AF_INET6 are currently "
|
||||
"the only supported address families");
|
||||
return std::make_pair(false, errMsg);
|
||||
}
|
||||
struct sockaddr_in server; // server address information
|
||||
|
||||
// Get a socket for accepting connections.
|
||||
if ((_serverFd = socket(_addressFamily, SOCK_STREAM, 0)) < 0)
|
||||
if ((_serverFd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error creating socket): " << strerror(Socket::getErrno());
|
||||
@ -84,63 +79,27 @@ namespace ix
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
|
||||
if (_addressFamily == AF_INET)
|
||||
// Bind the socket to the server address.
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_port = htons(_port);
|
||||
|
||||
// Using INADDR_ANY trigger a pop-up box as binding to any address is detected
|
||||
// by the osx firewall. We need to codesign the binary with a self-signed cert
|
||||
// to allow that, but this is a bit of a pain. (this is what node or python would do).
|
||||
//
|
||||
// Using INADDR_LOOPBACK also does not work ... while it should.
|
||||
// We default to 127.0.0.1 (localhost)
|
||||
//
|
||||
server.sin_addr.s_addr = inet_addr(_host.c_str());
|
||||
|
||||
if (bind(_serverFd, (struct sockaddr*) &server, sizeof(server)) < 0)
|
||||
{
|
||||
struct sockaddr_in server;
|
||||
server.sin_family = _addressFamily;
|
||||
server.sin_port = htons(_port);
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error calling bind "
|
||||
<< "at address " << _host << ":" << _port << " : " << strerror(Socket::getErrno());
|
||||
|
||||
if (inet_pton(_addressFamily, _host.c_str(), &server.sin_addr.s_addr) <= 0)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error calling inet_pton "
|
||||
<< "at address " << _host << ":" << _port << " : "
|
||||
<< strerror(Socket::getErrno());
|
||||
|
||||
Socket::closeSocket(_serverFd);
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
|
||||
// Bind the socket to the server address.
|
||||
if (bind(_serverFd, (struct sockaddr*) &server, sizeof(server)) < 0)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error calling bind "
|
||||
<< "at address " << _host << ":" << _port << " : "
|
||||
<< strerror(Socket::getErrno());
|
||||
|
||||
Socket::closeSocket(_serverFd);
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
}
|
||||
else // AF_INET6
|
||||
{
|
||||
struct sockaddr_in6 server;
|
||||
server.sin6_family = _addressFamily;
|
||||
server.sin6_port = htons(_port);
|
||||
|
||||
if (inet_pton(_addressFamily, _host.c_str(), &server.sin6_addr) <= 0)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error calling inet_pton "
|
||||
<< "at address " << _host << ":" << _port << " : "
|
||||
<< strerror(Socket::getErrno());
|
||||
|
||||
Socket::closeSocket(_serverFd);
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
|
||||
// Bind the socket to the server address.
|
||||
if (bind(_serverFd, (struct sockaddr*) &server, sizeof(server)) < 0)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "SocketServer::listen() error calling bind "
|
||||
<< "at address " << _host << ":" << _port << " : "
|
||||
<< strerror(Socket::getErrno());
|
||||
|
||||
Socket::closeSocket(_serverFd);
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
Socket::closeSocket(_serverFd);
|
||||
return std::make_pair(false, ss.str());
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -36,8 +36,7 @@ namespace ix
|
||||
SocketServer(int port = SocketServer::kDefaultPort,
|
||||
const std::string& host = SocketServer::kDefaultHost,
|
||||
int backlog = SocketServer::kDefaultTcpBacklog,
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections,
|
||||
int addressFamily = SocketServer::kDefaultAddressFamily);
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections);
|
||||
virtual ~SocketServer();
|
||||
virtual void stop();
|
||||
|
||||
@ -50,7 +49,6 @@ namespace ix
|
||||
const static std::string kDefaultHost;
|
||||
const static int kDefaultTcpBacklog;
|
||||
const static size_t kDefaultMaxConnections;
|
||||
const static int kDefaultAddressFamily;
|
||||
|
||||
void start();
|
||||
std::pair<bool, std::string> listen();
|
||||
@ -71,7 +69,6 @@ namespace ix
|
||||
std::string _host;
|
||||
int _backlog;
|
||||
size_t _maxConnections;
|
||||
int _addressFamily;
|
||||
|
||||
// socket for accepting connections
|
||||
int _serverFd;
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
@ -72,16 +71,4 @@ namespace ix
|
||||
{
|
||||
return _errMsg;
|
||||
}
|
||||
|
||||
std::string SocketTLSOptions::getDescription() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "TLS Options:" << std::endl;
|
||||
ss << " certFile = " << certFile << std::endl;
|
||||
ss << " keyFile = " << keyFile << std::endl;
|
||||
ss << " caFile = " << caFile << std::endl;
|
||||
ss << " ciphers = " << ciphers << std::endl;
|
||||
ss << " ciphers = " << ciphers << std::endl;
|
||||
return ss.str();
|
||||
}
|
||||
} // namespace ix
|
||||
|
@ -43,10 +43,8 @@ namespace ix
|
||||
|
||||
const std::string& getErrorMsg() const;
|
||||
|
||||
std::string getDescription() const;
|
||||
|
||||
private:
|
||||
mutable std::string _errMsg;
|
||||
mutable bool _validated = false;
|
||||
mutable bool _validated;
|
||||
};
|
||||
} // namespace ix
|
||||
|
@ -134,13 +134,6 @@ namespace ix
|
||||
_enablePong = false;
|
||||
}
|
||||
|
||||
void WebSocket::enablePerMessageDeflate()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_configMutex);
|
||||
WebSocketPerMessageDeflateOptions perMessageDeflateOptions(true);
|
||||
_perMessageDeflateOptions = perMessageDeflateOptions;
|
||||
}
|
||||
|
||||
void WebSocket::disablePerMessageDeflate()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_configMutex);
|
||||
@ -176,7 +169,6 @@ namespace ix
|
||||
// wait until working thread will exit
|
||||
// it will exit after close operation is finished
|
||||
_stop = true;
|
||||
_sleepCondition.notify_one();
|
||||
_thread.join();
|
||||
_stop = false;
|
||||
}
|
||||
@ -198,19 +190,9 @@ namespace ix
|
||||
auto subProtocols = getSubProtocols();
|
||||
if (!subProtocols.empty())
|
||||
{
|
||||
//
|
||||
// Sub Protocol strings are comma separated.
|
||||
// Python code to do that is:
|
||||
// >>> ','.join(['json', 'msgpack'])
|
||||
// 'json,msgpack'
|
||||
//
|
||||
int i = 0;
|
||||
for (auto subProtocol : subProtocols)
|
||||
{
|
||||
if (i++ != 0)
|
||||
{
|
||||
subProtocolsHeader += ",";
|
||||
}
|
||||
subProtocolsHeader += ",";
|
||||
subProtocolsHeader += subProtocol;
|
||||
}
|
||||
headers["Sec-WebSocket-Protocol"] = subProtocolsHeader;
|
||||
@ -300,13 +282,8 @@ namespace ix
|
||||
// Only sleep if we are retrying
|
||||
if (duration.count() > 0)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(_sleepMutex);
|
||||
_sleepCondition.wait_for(lock, duration);
|
||||
}
|
||||
|
||||
if (_stop)
|
||||
{
|
||||
break;
|
||||
// to do: make sleeping conditional
|
||||
std::this_thread::sleep_for(duration);
|
||||
}
|
||||
|
||||
// Try to connect synchronously
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "IXWebSocketSendInfo.h"
|
||||
#include "IXWebSocketTransport.h"
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
@ -57,7 +56,6 @@ namespace ix
|
||||
void setPingTimeout(int pingTimeoutSecs);
|
||||
void enablePong();
|
||||
void disablePong();
|
||||
void enablePerMessageDeflate();
|
||||
void disablePerMessageDeflate();
|
||||
void addSubProtocol(const std::string& subProtocol);
|
||||
|
||||
@ -142,10 +140,6 @@ namespace ix
|
||||
static const uint32_t kDefaultMaxWaitBetweenReconnectionRetries;
|
||||
uint32_t _maxWaitBetweenReconnectionRetries;
|
||||
|
||||
// Make the sleeping in the automatic reconnection cancellable
|
||||
std::mutex _sleepMutex;
|
||||
std::condition_variable _sleepCondition;
|
||||
|
||||
std::atomic<int> _handshakeTimeoutSecs;
|
||||
static const int kDefaultHandShakeTimeoutSecs;
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "IXUserAgent.h"
|
||||
#include "libwshandshake.hpp"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
|
||||
@ -179,8 +178,8 @@ namespace ix
|
||||
if (status != 101)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Expecting status 101 (Switching Protocol), got " << status
|
||||
<< " status connecting to " << host << ":" << port << ", HTTP Status line: " << line;
|
||||
ss << "Got bad status connecting to " << host << ":" << port << ", status: " << status
|
||||
<< ", HTTP Status line: " << line;
|
||||
return WebSocketInitResult(false, status, ss.str());
|
||||
}
|
||||
|
||||
@ -336,9 +335,8 @@ namespace ix
|
||||
std::string header = headers["sec-websocket-extensions"];
|
||||
WebSocketPerMessageDeflateOptions webSocketPerMessageDeflateOptions(header);
|
||||
|
||||
// If the client has requested that extension,
|
||||
// and the server does not prevent it, enable it.
|
||||
if (_enablePerMessageDeflate && webSocketPerMessageDeflateOptions.enabled())
|
||||
// If the client has requested that extension, enable it.
|
||||
if (webSocketPerMessageDeflateOptions.enabled())
|
||||
{
|
||||
_enablePerMessageDeflate = true;
|
||||
|
||||
|
@ -66,23 +66,12 @@ namespace ix
|
||||
{
|
||||
line[i] = '\0';
|
||||
std::string lineStr(line);
|
||||
// colon is ':', usually colon+1 is ' ', and colon+2 is the start of the value.
|
||||
// some webservers do not put a space after the colon character, so
|
||||
// the start of the value might be farther than colon+2.
|
||||
// The spec says that space after the : should be discarded.
|
||||
// colon is ':', colon+1 is ' ', colon+2 is the start of the value.
|
||||
// i is end of string (\0), i-colon is length of string minus key;
|
||||
// subtract 1 for '\0', 1 for '\n', 1 for '\r',
|
||||
// 1 for the ' ' after the ':', and total is -4
|
||||
// since we use an std::string later on and don't account for '\0',
|
||||
// plus the optional first space, total is -2
|
||||
int start = colon + 1;
|
||||
while (lineStr[start] == ' ')
|
||||
{
|
||||
start++;
|
||||
}
|
||||
|
||||
std::string name(lineStr.substr(0, colon));
|
||||
std::string value(lineStr.substr(start, lineStr.size() - start - 2));
|
||||
std::string value(lineStr.substr(colon + 2, i - colon - 4));
|
||||
|
||||
headers[name] = value;
|
||||
}
|
||||
|
@ -23,12 +23,10 @@ namespace ix
|
||||
const std::string& host,
|
||||
int backlog,
|
||||
size_t maxConnections,
|
||||
int handshakeTimeoutSecs,
|
||||
int addressFamily)
|
||||
: SocketServer(port, host, backlog, maxConnections, addressFamily)
|
||||
int handshakeTimeoutSecs)
|
||||
: SocketServer(port, host, backlog, maxConnections)
|
||||
, _handshakeTimeoutSecs(handshakeTimeoutSecs)
|
||||
, _enablePong(kDefaultEnablePong)
|
||||
, _enablePerMessageDeflate(true)
|
||||
{
|
||||
}
|
||||
|
||||
@ -60,11 +58,6 @@ namespace ix
|
||||
_enablePong = false;
|
||||
}
|
||||
|
||||
void WebSocketServer::disablePerMessageDeflate()
|
||||
{
|
||||
_enablePerMessageDeflate = false;
|
||||
}
|
||||
|
||||
void WebSocketServer::setOnConnectionCallback(const OnConnectionCallback& callback)
|
||||
{
|
||||
_onConnectionCallback = callback;
|
||||
@ -79,22 +72,9 @@ namespace ix
|
||||
webSocket->disableAutomaticReconnection();
|
||||
|
||||
if (_enablePong)
|
||||
{
|
||||
webSocket->enablePong();
|
||||
}
|
||||
else
|
||||
{
|
||||
webSocket->disablePong();
|
||||
}
|
||||
|
||||
if (_enablePerMessageDeflate)
|
||||
{
|
||||
webSocket->enablePerMessageDeflate();
|
||||
}
|
||||
else
|
||||
{
|
||||
webSocket->disablePerMessageDeflate();
|
||||
}
|
||||
|
||||
// Add this client to our client set
|
||||
{
|
||||
@ -126,6 +106,7 @@ namespace ix
|
||||
}
|
||||
}
|
||||
|
||||
logInfo("WebSocketServer::handleConnection() done");
|
||||
connectionState->setTerminated();
|
||||
}
|
||||
|
||||
|
@ -29,33 +29,29 @@ namespace ix
|
||||
const std::string& host = SocketServer::kDefaultHost,
|
||||
int backlog = SocketServer::kDefaultTcpBacklog,
|
||||
size_t maxConnections = SocketServer::kDefaultMaxConnections,
|
||||
int handshakeTimeoutSecs = WebSocketServer::kDefaultHandShakeTimeoutSecs,
|
||||
int addressFamily = SocketServer::kDefaultAddressFamily);
|
||||
int handshakeTimeoutSecs = WebSocketServer::kDefaultHandShakeTimeoutSecs);
|
||||
virtual ~WebSocketServer();
|
||||
virtual void stop() final;
|
||||
|
||||
void enablePong();
|
||||
void disablePong();
|
||||
void disablePerMessageDeflate();
|
||||
|
||||
void setOnConnectionCallback(const OnConnectionCallback& callback);
|
||||
|
||||
// Get all the connected clients
|
||||
std::set<std::shared_ptr<WebSocket>> getClients();
|
||||
|
||||
const static int kDefaultHandShakeTimeoutSecs;
|
||||
|
||||
private:
|
||||
// Member variables
|
||||
int _handshakeTimeoutSecs;
|
||||
bool _enablePong;
|
||||
bool _enablePerMessageDeflate;
|
||||
|
||||
OnConnectionCallback _onConnectionCallback;
|
||||
|
||||
std::mutex _clientsMutex;
|
||||
std::set<std::shared_ptr<WebSocket>> _clients;
|
||||
|
||||
const static int kDefaultHandShakeTimeoutSecs;
|
||||
const static bool kDefaultEnablePong;
|
||||
|
||||
// Methods
|
||||
|
@ -77,7 +77,6 @@ namespace ix
|
||||
|
||||
WebSocketTransport::WebSocketTransport()
|
||||
: _useMask(true)
|
||||
, _blockingSend(false)
|
||||
, _compressedMessage(false)
|
||||
, _readyState(ReadyState::CLOSED)
|
||||
, _closeCode(WebSocketCloseConstants::kInternalErrorCode)
|
||||
@ -144,9 +143,7 @@ namespace ix
|
||||
|
||||
if (!UrlParser::parse(url, protocol, host, path, query, port))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Could not parse url: '" << url << "'";
|
||||
return WebSocketInitResult(false, 0, ss.str());
|
||||
return WebSocketInitResult(false, 0, std::string("Could not parse URL ") + url);
|
||||
}
|
||||
|
||||
std::string errorMsg;
|
||||
@ -181,7 +178,6 @@ namespace ix
|
||||
|
||||
// Server should not mask the data it sends to the client
|
||||
_useMask = false;
|
||||
_blockingSend = true;
|
||||
|
||||
_socket = socket;
|
||||
|
||||
@ -343,16 +339,48 @@ namespace ix
|
||||
// there can be a lot of it for large messages.
|
||||
if (pollResult == PollResultType::SendRequest)
|
||||
{
|
||||
if (!flushSendBuffer())
|
||||
while (!isSendBufferEmpty() && !_requestInitCancellation)
|
||||
{
|
||||
return PollResult::CannotFlushSendBuffer;
|
||||
// Wait with a 10ms timeout until the socket is ready to write.
|
||||
// This way we are not busy looping
|
||||
PollResultType result = _socket->isReadyToWrite(10);
|
||||
|
||||
if (result == PollResultType::Error)
|
||||
{
|
||||
closeSocket();
|
||||
setReadyState(ReadyState::CLOSED);
|
||||
break;
|
||||
}
|
||||
else if (result == PollResultType::ReadyForWrite)
|
||||
{
|
||||
sendOnSocket();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pollResult == PollResultType::ReadyForRead)
|
||||
{
|
||||
if (!receiveFromSocket())
|
||||
while (true)
|
||||
{
|
||||
return PollResult::AbnormalClose;
|
||||
ssize_t ret = _socket->recv((char*) &_readbuf[0], _readbuf.size());
|
||||
|
||||
if (ret < 0 && Socket::isWaitNeeded())
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (ret <= 0)
|
||||
{
|
||||
// if there are received data pending to be processed, then delay the abnormal
|
||||
// closure to after dispatch (other close code/reason could be read from the
|
||||
// buffer)
|
||||
|
||||
closeSocket();
|
||||
|
||||
return PollResult::AbnormalClose;
|
||||
}
|
||||
else
|
||||
{
|
||||
_rxbuf.insert(_rxbuf.end(), _readbuf.begin(), _readbuf.begin() + ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pollResult == PollResultType::Error)
|
||||
@ -720,7 +748,7 @@ namespace ix
|
||||
|
||||
// if an abnormal closure was raised in poll, and nothing else triggered a CLOSED state in
|
||||
// the received and processed data then close the connection
|
||||
if (pollResult != PollResult::Succeeded)
|
||||
if (pollResult == PollResult::AbnormalClose)
|
||||
{
|
||||
_rxbuf.clear();
|
||||
|
||||
@ -846,12 +874,10 @@ namespace ix
|
||||
_txbuf.reserve(wireSize);
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
// Common case for most message. No fragmentation required.
|
||||
if (wireSize < kChunkSize)
|
||||
{
|
||||
success = sendFragment(type, true, message_begin, message_end, compress);
|
||||
sendFragment(type, true, message_begin, message_end, compress);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -887,10 +913,7 @@ namespace ix
|
||||
}
|
||||
|
||||
// Send message
|
||||
if (!sendFragment(opcodeType, fin, begin, end, compress))
|
||||
{
|
||||
return WebSocketSendInfo(false);
|
||||
}
|
||||
sendFragment(opcodeType, fin, begin, end, compress);
|
||||
|
||||
if (onProgressCallback && !onProgressCallback((int) i, (int) steps))
|
||||
{
|
||||
@ -905,18 +928,12 @@ namespace ix
|
||||
if (!isSendBufferEmpty())
|
||||
{
|
||||
_socket->wakeUpFromPoll(Socket::kSendRequest);
|
||||
|
||||
// FIXME: we should have a timeout when sending large messages: see #131
|
||||
if (_blockingSend && !flushSendBuffer())
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
return WebSocketSendInfo(success, compressionError, payloadSize, wireSize);
|
||||
return WebSocketSendInfo(true, compressionError, payloadSize, wireSize);
|
||||
}
|
||||
|
||||
bool WebSocketTransport::sendFragment(wsheader_type::opcode_type type,
|
||||
void WebSocketTransport::sendFragment(wsheader_type::opcode_type type,
|
||||
bool fin,
|
||||
std::string::const_iterator message_begin,
|
||||
std::string::const_iterator message_end,
|
||||
@ -1001,7 +1018,7 @@ namespace ix
|
||||
appendToSendBuffer(header, message_begin, message_end, message_size, masking_key);
|
||||
|
||||
// Now actually send this data
|
||||
return sendOnSocket();
|
||||
sendOnSocket();
|
||||
}
|
||||
|
||||
WebSocketSendInfo WebSocketTransport::sendPing(const std::string& message)
|
||||
@ -1034,17 +1051,19 @@ namespace ix
|
||||
wsheader_type::TEXT_FRAME, message, _enablePerMessageDeflate, onProgressCallback);
|
||||
}
|
||||
|
||||
bool WebSocketTransport::sendOnSocket()
|
||||
ssize_t WebSocketTransport::send()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_socketMutex);
|
||||
return _socket->send((char*) &_txbuf[0], _txbuf.size());
|
||||
}
|
||||
|
||||
void WebSocketTransport::sendOnSocket()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_txbufMutex);
|
||||
|
||||
while (_txbuf.size())
|
||||
{
|
||||
ssize_t ret = 0;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_socketMutex);
|
||||
ret = _socket->send((char*) &_txbuf[0], _txbuf.size());
|
||||
}
|
||||
ssize_t ret = send();
|
||||
|
||||
if (ret < 0 && Socket::isWaitNeeded())
|
||||
{
|
||||
@ -1054,43 +1073,13 @@ namespace ix
|
||||
{
|
||||
closeSocket();
|
||||
setReadyState(ReadyState::CLOSED);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_txbuf.erase(_txbuf.begin(), _txbuf.begin() + ret);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebSocketTransport::receiveFromSocket()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
ssize_t ret = _socket->recv((char*) &_readbuf[0], _readbuf.size());
|
||||
|
||||
if (ret < 0 && Socket::isWaitNeeded())
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (ret <= 0)
|
||||
{
|
||||
// if there are received data pending to be processed, then delay the abnormal
|
||||
// closure to after dispatch (other close code/reason could be read from the
|
||||
// buffer)
|
||||
|
||||
closeSocket();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_rxbuf.insert(_rxbuf.end(), _readbuf.begin(), _readbuf.begin() + ret);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WebSocketTransport::sendCloseFrame(uint16_t code, const std::string& reason)
|
||||
@ -1179,30 +1168,4 @@ namespace ix
|
||||
return _txbuf.size();
|
||||
}
|
||||
|
||||
bool WebSocketTransport::flushSendBuffer()
|
||||
{
|
||||
while (!isSendBufferEmpty() && !_requestInitCancellation)
|
||||
{
|
||||
// Wait with a 10ms timeout until the socket is ready to write.
|
||||
// This way we are not busy looping
|
||||
PollResultType result = _socket->isReadyToWrite(10);
|
||||
|
||||
if (result == PollResultType::Error)
|
||||
{
|
||||
closeSocket();
|
||||
setReadyState(ReadyState::CLOSED);
|
||||
return false;
|
||||
}
|
||||
else if (result == PollResultType::ReadyForWrite)
|
||||
{
|
||||
if (!sendOnSocket())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ix
|
||||
|
@ -61,8 +61,7 @@ namespace ix
|
||||
enum class PollResult
|
||||
{
|
||||
Succeeded,
|
||||
AbnormalClose,
|
||||
CannotFlushSendBuffer
|
||||
AbnormalClose
|
||||
};
|
||||
|
||||
using OnMessageCallback =
|
||||
@ -99,6 +98,7 @@ namespace ix
|
||||
bool remote = false);
|
||||
|
||||
void closeSocket();
|
||||
ssize_t send();
|
||||
|
||||
ReadyState getReadyState() const;
|
||||
void setReadyState(ReadyState readyState);
|
||||
@ -135,10 +135,6 @@ namespace ix
|
||||
// client should mask but server should not
|
||||
std::atomic<bool> _useMask;
|
||||
|
||||
// Tells whether we should flush the send buffer before
|
||||
// saying that a send is complete. This is the mode for server code.
|
||||
std::atomic<bool> _blockingSend;
|
||||
|
||||
// Buffer for reading from our socket. That buffer is never resized.
|
||||
std::vector<uint8_t> _readbuf;
|
||||
|
||||
@ -242,16 +238,13 @@ namespace ix
|
||||
size_t closeWireSize,
|
||||
bool remote);
|
||||
|
||||
bool flushSendBuffer();
|
||||
bool sendOnSocket();
|
||||
bool receiveFromSocket();
|
||||
|
||||
void sendOnSocket();
|
||||
WebSocketSendInfo sendData(wsheader_type::opcode_type type,
|
||||
const std::string& message,
|
||||
bool compress,
|
||||
const OnProgressCallback& onProgressCallback = nullptr);
|
||||
|
||||
bool sendFragment(wsheader_type::opcode_type type,
|
||||
void sendFragment(wsheader_type::opcode_type type,
|
||||
bool fin,
|
||||
std::string::const_iterator begin,
|
||||
std::string::const_iterator end,
|
||||
|
@ -6,4 +6,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define IX_WEBSOCKET_VERSION "8.1.4"
|
||||
#define IX_WEBSOCKET_VERSION "7.4.1"
|
||||
|
12
makefile
12
makefile
@ -30,7 +30,7 @@ uninstall:
|
||||
xargs rm -fv < build/install_manifest.txt
|
||||
|
||||
tag:
|
||||
git tag v"`sh tools/extract_version.sh`"
|
||||
git tag v"`cat DOCKER_VERSION`"
|
||||
|
||||
xcode:
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 -DUSE_TEST=1 -GXcode && open ixwebsocket.xcodeproj
|
||||
@ -40,18 +40,12 @@ xcode_openssl:
|
||||
|
||||
.PHONY: docker
|
||||
|
||||
NAME := ${DOCKER_REPO}/ws
|
||||
TAG := $(shell sh tools/extract_version.sh)
|
||||
NAME := bsergean/ws
|
||||
TAG := $(shell cat DOCKER_VERSION)
|
||||
IMG := ${NAME}:${TAG}
|
||||
LATEST := ${NAME}:latest
|
||||
BUILD := ${NAME}:build
|
||||
|
||||
print_version:
|
||||
@echo 'IXWebSocket version =>' ${TAG}
|
||||
|
||||
set_version:
|
||||
sh tools/update_version.sh ${VERSION}
|
||||
|
||||
docker_test:
|
||||
docker build -f docker/Dockerfile.debian -t bsergean/ixwebsocket_test:build .
|
||||
|
||||
|
@ -23,22 +23,13 @@ include_directories(
|
||||
../ws
|
||||
)
|
||||
|
||||
add_definitions(-DSPDLOG_COMPILED_LIB=1)
|
||||
|
||||
find_package(JsonCpp)
|
||||
if (NOT JSONCPP_FOUND)
|
||||
include_directories(../third_party/jsoncpp)
|
||||
set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp)
|
||||
endif()
|
||||
|
||||
# Shared sources
|
||||
set (SOURCES
|
||||
${JSONCPP_SOURCES}
|
||||
|
||||
test_runner.cpp
|
||||
IXTest.cpp
|
||||
IXGetFreePort.cpp
|
||||
../third_party/msgpack11/msgpack11.cpp
|
||||
../third_party/jsoncpp/jsoncpp.cpp
|
||||
|
||||
IXSocketTest.cpp
|
||||
IXSocketConnectTest.cpp
|
||||
@ -55,12 +46,12 @@ set (SOURCES
|
||||
IXDNSLookupTest.cpp
|
||||
IXWebSocketSubProtocolTest.cpp
|
||||
IXSentryClientTest.cpp
|
||||
IXWebSocketChatTest.cpp
|
||||
)
|
||||
|
||||
# Some unittest don't work on windows yet
|
||||
if (UNIX)
|
||||
list(APPEND SOURCES
|
||||
IXWebSocketChatTest.cpp
|
||||
IXWebSocketCloseTest.cpp
|
||||
)
|
||||
endif()
|
||||
@ -88,11 +79,6 @@ if (APPLE AND USE_TLS)
|
||||
target_link_libraries(ixwebsocket_unittest "-framework foundation" "-framework security")
|
||||
endif()
|
||||
|
||||
if (JSONCPP_FOUND)
|
||||
target_include_directories(ixwebsocket_unittest PUBLIC ${JSONCPP_INCLUDE_DIRS})
|
||||
target_link_libraries(ixwebsocket_unittest ${JSONCPP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
target_link_libraries(ixwebsocket_unittest ixsnake)
|
||||
target_link_libraries(ixwebsocket_unittest ixcobra)
|
||||
target_link_libraries(ixwebsocket_unittest ixwebsocket)
|
||||
@ -100,6 +86,4 @@ target_link_libraries(ixwebsocket_unittest ixcrypto)
|
||||
target_link_libraries(ixwebsocket_unittest ixcore)
|
||||
target_link_libraries(ixwebsocket_unittest ixsentry)
|
||||
|
||||
target_link_libraries(ixwebsocket_unittest spdlog)
|
||||
|
||||
install(TARGETS ixwebsocket_unittest DESTINATION bin)
|
||||
|
@ -34,10 +34,12 @@ namespace
|
||||
});
|
||||
}
|
||||
|
||||
class CobraChat
|
||||
class SatoriChat
|
||||
{
|
||||
public:
|
||||
CobraChat(const std::string& user, const std::string& session, const std::string& endpoint);
|
||||
SatoriChat(const std::string& user,
|
||||
const std::string& session,
|
||||
const std::string& endpoint);
|
||||
|
||||
void subscribe(const std::string& channel);
|
||||
void start();
|
||||
@ -70,9 +72,9 @@ namespace
|
||||
std::mutex _logMutex;
|
||||
};
|
||||
|
||||
CobraChat::CobraChat(const std::string& user,
|
||||
const std::string& session,
|
||||
const std::string& endpoint)
|
||||
SatoriChat::SatoriChat(const std::string& user,
|
||||
const std::string& session,
|
||||
const std::string& endpoint)
|
||||
: _user(user)
|
||||
, _session(session)
|
||||
, _endpoint(endpoint)
|
||||
@ -81,34 +83,34 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void CobraChat::start()
|
||||
void SatoriChat::start()
|
||||
{
|
||||
_thread = std::thread(&CobraChat::run, this);
|
||||
_thread = std::thread(&SatoriChat::run, this);
|
||||
}
|
||||
|
||||
void CobraChat::stop()
|
||||
void SatoriChat::stop()
|
||||
{
|
||||
_stop = true;
|
||||
_thread.join();
|
||||
}
|
||||
|
||||
bool CobraChat::isReady() const
|
||||
bool SatoriChat::isReady() const
|
||||
{
|
||||
return _connectedAndSubscribed;
|
||||
}
|
||||
|
||||
size_t CobraChat::getReceivedMessagesCount() const
|
||||
size_t SatoriChat::getReceivedMessagesCount() const
|
||||
{
|
||||
return _receivedQueue.size();
|
||||
}
|
||||
|
||||
bool CobraChat::hasPendingMessages() const
|
||||
bool SatoriChat::hasPendingMessages() const
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(_queue_mutex);
|
||||
return !_publish_queue.empty();
|
||||
}
|
||||
|
||||
Json::Value CobraChat::popMessage()
|
||||
Json::Value SatoriChat::popMessage()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(_queue_mutex);
|
||||
auto msg = _publish_queue.front();
|
||||
@ -119,7 +121,7 @@ namespace
|
||||
//
|
||||
// Callback to handle received messages, that are printed on the console
|
||||
//
|
||||
void CobraChat::subscribe(const std::string& channel)
|
||||
void SatoriChat::subscribe(const std::string& channel)
|
||||
{
|
||||
std::string filter;
|
||||
_conn.subscribe(channel, filter, [this](const Json::Value& msg) {
|
||||
@ -149,7 +151,7 @@ namespace
|
||||
});
|
||||
}
|
||||
|
||||
void CobraChat::sendMessage(const std::string& text)
|
||||
void SatoriChat::sendMessage(const std::string& text)
|
||||
{
|
||||
Json::Value msg;
|
||||
msg["user"] = _user;
|
||||
@ -164,21 +166,16 @@ namespace
|
||||
// Do satori communication on a background thread, where we can have
|
||||
// something like an event loop that publish, poll and receive data
|
||||
//
|
||||
void CobraChat::run()
|
||||
void SatoriChat::run()
|
||||
{
|
||||
// "chat" conf
|
||||
std::string appkey("FC2F10139A2BAc53BB72D9db967b024f");
|
||||
std::string channel = _session;
|
||||
std::string role = "_sub";
|
||||
std::string secret = "66B1dA3ED5fA074EB5AE84Dd8CE3b5ba";
|
||||
SocketTLSOptions socketTLSOptions;
|
||||
|
||||
_conn.configure(appkey,
|
||||
_endpoint,
|
||||
role,
|
||||
secret,
|
||||
ix::WebSocketPerMessageDeflateOptions(true),
|
||||
socketTLSOptions);
|
||||
_conn.configure(
|
||||
appkey, _endpoint, role, secret, ix::WebSocketPerMessageDeflateOptions(true));
|
||||
_conn.connect();
|
||||
|
||||
_conn.setEventCallback([this, channel](ix::CobraConnectionEventType eventType,
|
||||
@ -283,8 +280,8 @@ TEST_CASE("Cobra_chat", "[cobra_chat]")
|
||||
ss << "ws://localhost:" << port;
|
||||
std::string endpoint = ss.str();
|
||||
|
||||
CobraChat chatA("jean", session, endpoint);
|
||||
CobraChat chatB("paul", session, endpoint);
|
||||
SatoriChat chatA("jean", session, endpoint);
|
||||
SatoriChat chatB("paul", session, endpoint);
|
||||
|
||||
chatA.start();
|
||||
chatB.start();
|
||||
|
@ -62,14 +62,11 @@ namespace
|
||||
gMessageCount = 0;
|
||||
|
||||
ix::CobraConnection conn;
|
||||
SocketTLSOptions socketTLSOptions;
|
||||
|
||||
conn.configure(APPKEY,
|
||||
endpoint,
|
||||
SUBSCRIBER_ROLE,
|
||||
SUBSCRIBER_SECRET,
|
||||
ix::WebSocketPerMessageDeflateOptions(true),
|
||||
socketTLSOptions);
|
||||
ix::WebSocketPerMessageDeflateOptions(true));
|
||||
conn.connect();
|
||||
|
||||
conn.setEventCallback([&conn](ix::CobraConnectionEventType eventType,
|
||||
@ -205,15 +202,9 @@ TEST_CASE("Cobra_Metrics_Publisher", "[cobra]")
|
||||
|
||||
ix::CobraMetricsPublisher cobraMetricsPublisher;
|
||||
|
||||
SocketTLSOptions socketTLSOptions;
|
||||
bool perMessageDeflate = true;
|
||||
cobraMetricsPublisher.configure(APPKEY,
|
||||
endpoint,
|
||||
CHANNEL,
|
||||
PUBLISHER_ROLE,
|
||||
PUBLISHER_SECRET,
|
||||
perMessageDeflate,
|
||||
socketTLSOptions);
|
||||
cobraMetricsPublisher.configure(
|
||||
APPKEY, endpoint, CHANNEL, PUBLISHER_ROLE, PUBLISHER_SECRET, perMessageDeflate);
|
||||
cobraMetricsPublisher.setSession(uuid4());
|
||||
cobraMetricsPublisher.enable(true); // disabled by default, needs to be enabled to be active
|
||||
|
||||
|
@ -59,14 +59,10 @@ TEST_CASE("http server", "[httpd]")
|
||||
|
||||
REQUIRE(response->errorCode == HttpErrorCode::Ok);
|
||||
REQUIRE(response->statusCode == 200);
|
||||
REQUIRE(response->headers["Accept-Encoding"] == "gzip");
|
||||
|
||||
server.stop();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("http server redirection", "[httpd_redirect]")
|
||||
{
|
||||
SECTION("Connect to a local HTTP server, with redirection enabled")
|
||||
{
|
||||
int port = getFreePort();
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,36 +0,0 @@
|
||||
from websocket import *
|
||||
|
||||
import random
|
||||
import string
|
||||
import ssl
|
||||
|
||||
def randomString(stringLength=10):
|
||||
"""Generate a random string of fixed length """
|
||||
letters = string.ascii_lowercase
|
||||
return ''.join(random.choice(letters) for i in range(stringLength))
|
||||
|
||||
st = randomString(32768)
|
||||
|
||||
with open('generated_file', 'w') as f:
|
||||
f.write(st)
|
||||
|
||||
ws = create_connection("wss://echo.websocket.org/",
|
||||
sslopt={"cert_reqs": ssl.CERT_NONE})
|
||||
|
||||
print("Sending")
|
||||
|
||||
frame = ABNF.create_frame(st, ABNF.OPCODE_TEXT, 0)
|
||||
ws.send_frame(frame)
|
||||
cont_frame = ABNF.create_frame(st, ABNF.OPCODE_CONT, 0)
|
||||
ws.send_frame(cont_frame)
|
||||
cont_frame = ABNF.create_frame(st, ABNF.OPCODE_CONT, 1)
|
||||
ws.send_frame(cont_frame)
|
||||
|
||||
print("Sent")
|
||||
print("Receiving...")
|
||||
result = ws.recv()
|
||||
if st+st+st == result:
|
||||
print("Received ")
|
||||
else:
|
||||
print("Error")
|
||||
ws.close()
|
@ -1,17 +1,8 @@
|
||||
FROM python:3.8.0-alpine3.10
|
||||
|
||||
RUN pip install websockets
|
||||
COPY ws_proxy.py /usr/bin
|
||||
RUN chmod +x /usr/bin/ws_proxy.py
|
||||
|
||||
COPY vendor/protocol.py /usr/local/lib/python3.8/site-packages/websockets/protocol.py
|
||||
|
||||
COPY *.py /usr/bin/
|
||||
COPY entrypoint.sh /usr/bin/
|
||||
RUN chmod +x /usr/bin/*.py
|
||||
|
||||
RUN mkdir /certs
|
||||
COPY *.pem /certs/
|
||||
|
||||
WORKDIR /certs
|
||||
|
||||
EXPOSE 8765 8766
|
||||
CMD ["sh", "/usr/bin/entrypoint.sh"]
|
||||
EXPOSE 8765
|
||||
CMD ["python", "/usr/bin/ws_proxy.py"]
|
||||
|
@ -1,3 +0,0 @@
|
||||
nginx: nginx -p . -c nginx.conf
|
||||
websocket_server: python echo_server.py
|
||||
send: sleep 1 ; ws send -x --verify_none wss://localhost:8765 /usr/local/bin/ws
|
@ -28,819 +28,3 @@ connected (press CTRL+C to quit)
|
||||
< > Welcome !
|
||||
disconnected (code: 1006)
|
||||
```
|
||||
|
||||
# Server
|
||||
|
||||
```
|
||||
$ honcho start
|
||||
15:29:52 system | nginx.1 started (pid=75372)
|
||||
15:29:52 system | send.1 started (pid=75373)
|
||||
15:29:52 system | websocket_server.1 started (pid=75374)
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.414] [info] ws_send: Connecting to url: wss://localhost:8765
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.415] [info] ws_send: Connecting...
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] ws_send: connected
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] ws_send: Sending...
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Uri: /
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Headers:
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Connection: upgrade
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Date: Sun, 05 Jan 2020 23:29:53 GMT
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Sec-WebSocket-Accept: 2+7DV7Q0Ib3fxynZwaNTtsAepIk=
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Server: nginx/1.15.9
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.436] [info] Upgrade: websocket
|
||||
15:29:53 send.1 | [2020-01-05 15:29:53.633] [info] load file from disk completed in 197
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.267] [info] ws_send: Step 0 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.269] [info] ws_send: Step 1 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.271] [info] ws_send: Step 2 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.273] [info] ws_send: Step 3 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.275] [info] ws_send: Step 4 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.277] [info] ws_send: Step 5 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.278] [info] ws_send: Step 6 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.280] [info] ws_send: Step 7 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.282] [info] ws_send: Step 8 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.284] [info] ws_send: Step 9 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.286] [info] ws_send: Step 10 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.288] [info] ws_send: Step 11 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.289] [info] ws_send: Step 12 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.291] [info] ws_send: Step 13 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.293] [info] ws_send: Step 14 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.295] [info] ws_send: Step 15 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.297] [info] ws_send: Step 16 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.298] [info] ws_send: Step 17 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.300] [info] ws_send: Step 18 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.302] [info] ws_send: Step 19 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.304] [info] ws_send: Step 20 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.306] [info] ws_send: Step 21 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.308] [info] ws_send: Step 22 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.309] [info] ws_send: Step 23 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.311] [info] ws_send: Step 24 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.313] [info] ws_send: Step 25 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.315] [info] ws_send: Step 26 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.317] [info] ws_send: Step 27 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.319] [info] ws_send: Step 28 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.320] [info] ws_send: Step 29 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.322] [info] ws_send: Step 30 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.324] [info] ws_send: Step 31 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.326] [info] ws_send: Step 32 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.328] [info] ws_send: Step 33 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.329] [info] ws_send: Step 34 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.331] [info] ws_send: Step 35 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.333] [info] ws_send: Step 36 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.335] [info] ws_send: Step 37 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.337] [info] ws_send: Step 38 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.339] [info] ws_send: Step 39 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.340] [info] ws_send: Step 40 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.342] [info] ws_send: Step 41 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.344] [info] ws_send: Step 42 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.346] [info] ws_send: Step 43 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.348] [info] ws_send: Step 44 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.350] [info] ws_send: Step 45 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.351] [info] ws_send: Step 46 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.353] [info] ws_send: Step 47 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.355] [info] ws_send: Step 48 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.357] [info] ws_send: Step 49 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.359] [info] ws_send: Step 50 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.361] [info] ws_send: Step 51 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.362] [info] ws_send: Step 52 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.364] [info] ws_send: Step 53 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.366] [info] ws_send: Step 54 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.368] [info] ws_send: Step 55 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.370] [info] ws_send: Step 56 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.372] [info] ws_send: Step 57 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.373] [info] ws_send: Step 58 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.375] [info] ws_send: Step 59 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.377] [info] ws_send: Step 60 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.379] [info] ws_send: Step 61 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.381] [info] ws_send: Step 62 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.383] [info] ws_send: Step 63 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.384] [info] ws_send: Step 64 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.386] [info] ws_send: Step 65 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.388] [info] ws_send: Step 66 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.390] [info] ws_send: Step 67 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.392] [info] ws_send: Step 68 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.394] [info] ws_send: Step 69 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.395] [info] ws_send: Step 70 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.397] [info] ws_send: Step 71 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.399] [info] ws_send: Step 72 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.401] [info] ws_send: Step 73 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.403] [info] ws_send: Step 74 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.405] [info] ws_send: Step 75 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.407] [info] ws_send: Step 76 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.409] [info] ws_send: Step 77 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.411] [info] ws_send: Step 78 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.412] [info] ws_send: Step 79 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.414] [info] ws_send: Step 80 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.416] [info] ws_send: Step 81 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.418] [info] ws_send: Step 82 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.420] [info] ws_send: Step 83 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.421] [info] ws_send: Step 84 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.423] [info] ws_send: Step 85 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.425] [info] ws_send: Step 86 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.427] [info] ws_send: Step 87 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.429] [info] ws_send: Step 88 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.431] [info] ws_send: Step 89 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.432] [info] ws_send: Step 90 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.434] [info] ws_send: Step 91 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.436] [info] ws_send: Step 92 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.438] [info] ws_send: Step 93 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.440] [info] ws_send: Step 94 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.442] [info] ws_send: Step 95 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.444] [info] ws_send: Step 96 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.445] [info] ws_send: Step 97 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.447] [info] ws_send: Step 98 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.449] [info] ws_send: Step 99 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.451] [info] ws_send: Step 100 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.453] [info] ws_send: Step 101 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.454] [info] ws_send: Step 102 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.456] [info] ws_send: Step 103 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.458] [info] ws_send: Step 104 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.460] [info] ws_send: Step 105 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.462] [info] ws_send: Step 106 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.464] [info] ws_send: Step 107 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.465] [info] ws_send: Step 108 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.467] [info] ws_send: Step 109 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.469] [info] ws_send: Step 110 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.471] [info] ws_send: Step 111 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.473] [info] ws_send: Step 112 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.475] [info] ws_send: Step 113 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.476] [info] ws_send: Step 114 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.478] [info] ws_send: Step 115 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.480] [info] ws_send: Step 116 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.482] [info] ws_send: Step 117 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.484] [info] ws_send: Step 118 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.486] [info] ws_send: Step 119 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.488] [info] ws_send: Step 120 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.489] [info] ws_send: Step 121 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.491] [info] ws_send: Step 122 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.493] [info] ws_send: Step 123 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.495] [info] ws_send: Step 124 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.497] [info] ws_send: Step 125 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.499] [info] ws_send: Step 126 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.500] [info] ws_send: Step 127 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.502] [info] ws_send: Step 128 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.504] [info] ws_send: Step 129 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.506] [info] ws_send: Step 130 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.508] [info] ws_send: Step 131 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.509] [info] ws_send: Step 132 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.511] [info] ws_send: Step 133 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.513] [info] ws_send: Step 134 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.515] [info] ws_send: Step 135 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.517] [info] ws_send: Step 136 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.519] [info] ws_send: Step 137 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.520] [info] ws_send: Step 138 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.522] [info] ws_send: Step 139 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.524] [info] ws_send: Step 140 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.526] [info] ws_send: Step 141 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.528] [info] ws_send: Step 142 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.530] [info] ws_send: Step 143 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.531] [info] ws_send: Step 144 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.533] [info] ws_send: Step 145 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.535] [info] ws_send: Step 146 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.537] [info] ws_send: Step 147 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.539] [info] ws_send: Step 148 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.541] [info] ws_send: Step 149 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.542] [info] ws_send: Step 150 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.544] [info] ws_send: Step 151 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.546] [info] ws_send: Step 152 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.548] [info] ws_send: Step 153 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.550] [info] ws_send: Step 154 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.551] [info] ws_send: Step 155 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.553] [info] ws_send: Step 156 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.555] [info] ws_send: Step 157 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.557] [info] ws_send: Step 158 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.559] [info] ws_send: Step 159 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.561] [info] ws_send: Step 160 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.562] [info] ws_send: Step 161 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.564] [info] ws_send: Step 162 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.566] [info] ws_send: Step 163 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.568] [info] ws_send: Step 164 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.570] [info] ws_send: Step 165 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.571] [info] ws_send: Step 166 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.573] [info] ws_send: Step 167 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.575] [info] ws_send: Step 168 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.577] [info] ws_send: Step 169 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.579] [info] ws_send: Step 170 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.581] [info] ws_send: Step 171 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.582] [info] ws_send: Step 172 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.584] [info] ws_send: Step 173 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.586] [info] ws_send: Step 174 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.588] [info] ws_send: Step 175 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.590] [info] ws_send: Step 176 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.592] [info] ws_send: Step 177 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.593] [info] ws_send: Step 178 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.595] [info] ws_send: Step 179 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.597] [info] ws_send: Step 180 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.599] [info] ws_send: Step 181 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.601] [info] ws_send: Step 182 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.602] [info] ws_send: Step 183 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.604] [info] ws_send: Step 184 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.606] [info] ws_send: Step 185 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.608] [info] ws_send: Step 186 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.610] [info] ws_send: Step 187 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.612] [info] ws_send: Step 188 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.613] [info] ws_send: Step 189 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.615] [info] ws_send: Step 190 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.617] [info] ws_send: Step 191 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.619] [info] ws_send: Step 192 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.621] [info] ws_send: Step 193 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.622] [info] ws_send: Step 194 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.624] [info] ws_send: Step 195 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.626] [info] ws_send: Step 196 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.628] [info] ws_send: Step 197 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.630] [info] ws_send: Step 198 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.632] [info] ws_send: Step 199 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.633] [info] ws_send: Step 200 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.635] [info] ws_send: Step 201 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.637] [info] ws_send: Step 202 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.639] [info] ws_send: Step 203 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.641] [info] ws_send: Step 204 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.642] [info] ws_send: Step 205 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.644] [info] ws_send: Step 206 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.646] [info] ws_send: Step 207 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.648] [info] ws_send: Step 208 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.650] [info] ws_send: Step 209 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.652] [info] ws_send: Step 210 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.653] [info] ws_send: Step 211 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.655] [info] ws_send: Step 212 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.657] [info] ws_send: Step 213 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.659] [info] ws_send: Step 214 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.661] [info] ws_send: Step 215 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.663] [info] ws_send: Step 216 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.664] [info] ws_send: Step 217 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.666] [info] ws_send: Step 218 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.668] [info] ws_send: Step 219 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.670] [info] ws_send: Step 220 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.672] [info] ws_send: Step 221 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.674] [info] ws_send: Step 222 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.675] [info] ws_send: Step 223 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.677] [info] ws_send: Step 224 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.679] [info] ws_send: Step 225 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.681] [info] ws_send: Step 226 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.683] [info] ws_send: Step 227 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.685] [info] ws_send: Step 228 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.686] [info] ws_send: Step 229 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.688] [info] ws_send: Step 230 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.690] [info] ws_send: Step 231 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.692] [info] ws_send: Step 232 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.694] [info] ws_send: Step 233 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.695] [info] ws_send: Step 234 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.697] [info] ws_send: Step 235 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.699] [info] ws_send: Step 236 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.701] [info] ws_send: Step 237 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.703] [info] ws_send: Step 238 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.705] [info] ws_send: Step 239 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.707] [info] ws_send: Step 240 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.708] [info] ws_send: Step 241 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.710] [info] ws_send: Step 242 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.712] [info] ws_send: Step 243 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.714] [info] ws_send: Step 244 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.716] [info] ws_send: Step 245 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.718] [info] ws_send: Step 246 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.719] [info] ws_send: Step 247 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.721] [info] ws_send: Step 248 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.723] [info] ws_send: Step 249 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.725] [info] ws_send: Step 250 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.727] [info] ws_send: Step 251 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.729] [info] ws_send: Step 252 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.730] [info] ws_send: Step 253 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.732] [info] ws_send: Step 254 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.734] [info] ws_send: Step 255 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.736] [info] ws_send: Step 256 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.738] [info] ws_send: Step 257 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.740] [info] ws_send: Step 258 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.742] [info] ws_send: Step 259 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.743] [info] ws_send: Step 260 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.745] [info] ws_send: Step 261 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.747] [info] ws_send: Step 262 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.749] [info] ws_send: Step 263 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.751] [info] ws_send: Step 264 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.752] [info] ws_send: Step 265 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.754] [info] ws_send: Step 266 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.756] [info] ws_send: Step 267 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.758] [info] ws_send: Step 268 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.760] [info] ws_send: Step 269 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.762] [info] ws_send: Step 270 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.763] [info] ws_send: Step 271 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.765] [info] ws_send: Step 272 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.767] [info] ws_send: Step 273 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.769] [info] ws_send: Step 274 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.771] [info] ws_send: Step 275 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.772] [info] ws_send: Step 276 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.774] [info] ws_send: Step 277 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.776] [info] ws_send: Step 278 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.778] [info] ws_send: Step 279 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.780] [info] ws_send: Step 280 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.782] [info] ws_send: Step 281 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.783] [info] ws_send: Step 282 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.785] [info] ws_send: Step 283 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.787] [info] ws_send: Step 284 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.789] [info] ws_send: Step 285 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.791] [info] ws_send: Step 286 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.793] [info] ws_send: Step 287 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.794] [info] ws_send: Step 288 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.796] [info] ws_send: Step 289 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.798] [info] ws_send: Step 290 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.800] [info] ws_send: Step 291 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.802] [info] ws_send: Step 292 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.804] [info] ws_send: Step 293 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.805] [info] ws_send: Step 294 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.807] [info] ws_send: Step 295 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.809] [info] ws_send: Step 296 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.811] [info] ws_send: Step 297 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.813] [info] ws_send: Step 298 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.814] [info] ws_send: Step 299 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.816] [info] ws_send: Step 300 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.818] [info] ws_send: Step 301 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.820] [info] ws_send: Step 302 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.822] [info] ws_send: Step 303 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.824] [info] ws_send: Step 304 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.825] [info] ws_send: Step 305 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.827] [info] ws_send: Step 306 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.829] [info] ws_send: Step 307 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.831] [info] ws_send: Step 308 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.833] [info] ws_send: Step 309 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.835] [info] ws_send: Step 310 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.836] [info] ws_send: Step 311 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.838] [info] ws_send: Step 312 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.840] [info] ws_send: Step 313 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.842] [info] ws_send: Step 314 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.844] [info] ws_send: Step 315 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.845] [info] ws_send: Step 316 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.847] [info] ws_send: Step 317 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.849] [info] ws_send: Step 318 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.851] [info] ws_send: Step 319 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.853] [info] ws_send: Step 320 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.855] [info] ws_send: Step 321 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.856] [info] ws_send: Step 322 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.858] [info] ws_send: Step 323 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.860] [info] ws_send: Step 324 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.862] [info] ws_send: Step 325 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.864] [info] ws_send: Step 326 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.866] [info] ws_send: Step 327 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.867] [info] ws_send: Step 328 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.869] [info] ws_send: Step 329 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.871] [info] ws_send: Step 330 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.873] [info] ws_send: Step 331 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.875] [info] ws_send: Step 332 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.876] [info] ws_send: Step 333 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.878] [info] ws_send: Step 334 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.880] [info] ws_send: Step 335 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.882] [info] ws_send: Step 336 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.884] [info] ws_send: Step 337 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.886] [info] ws_send: Step 338 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.888] [info] ws_send: Step 339 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.889] [info] ws_send: Step 340 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.891] [info] ws_send: Step 341 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.893] [info] ws_send: Step 342 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.895] [info] ws_send: Step 343 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.897] [info] ws_send: Step 344 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.899] [info] ws_send: Step 345 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.900] [info] ws_send: Step 346 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.902] [info] ws_send: Step 347 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.904] [info] ws_send: Step 348 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.906] [info] ws_send: Step 349 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.908] [info] ws_send: Step 350 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.910] [info] ws_send: Step 351 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.911] [info] ws_send: Step 352 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.913] [info] ws_send: Step 353 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.915] [info] ws_send: Step 354 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.917] [info] ws_send: Step 355 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.919] [info] ws_send: Step 356 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.920] [info] ws_send: Step 357 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.922] [info] ws_send: Step 358 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.924] [info] ws_send: Step 359 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.926] [info] ws_send: Step 360 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.928] [info] ws_send: Step 361 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.930] [info] ws_send: Step 362 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.932] [info] ws_send: Step 363 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.933] [info] ws_send: Step 364 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.935] [info] ws_send: Step 365 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.937] [info] ws_send: Step 366 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.939] [info] ws_send: Step 367 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.941] [info] ws_send: Step 368 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.943] [info] ws_send: Step 369 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.944] [info] ws_send: Step 370 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.946] [info] ws_send: Step 371 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.948] [info] ws_send: Step 372 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.950] [info] ws_send: Step 373 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.952] [info] ws_send: Step 374 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.954] [info] ws_send: Step 375 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.955] [info] ws_send: Step 376 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.957] [info] ws_send: Step 377 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.959] [info] ws_send: Step 378 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.961] [info] ws_send: Step 379 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.963] [info] ws_send: Step 380 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.965] [info] ws_send: Step 381 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.966] [info] ws_send: Step 382 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.968] [info] ws_send: Step 383 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.970] [info] ws_send: Step 384 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.972] [info] ws_send: Step 385 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.974] [info] ws_send: Step 386 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.976] [info] ws_send: Step 387 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.977] [info] ws_send: Step 388 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.979] [info] ws_send: Step 389 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.981] [info] ws_send: Step 390 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.983] [info] ws_send: Step 391 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.985] [info] ws_send: Step 392 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.986] [info] ws_send: Step 393 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.988] [info] ws_send: Step 394 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.990] [info] ws_send: Step 395 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.992] [info] ws_send: Step 396 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.994] [info] ws_send: Step 397 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.996] [info] ws_send: Step 398 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.997] [info] ws_send: Step 399 out of 768
|
||||
15:29:54 send.1 | [2020-01-05 15:29:54.999] [info] ws_send: Step 400 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.001] [info] ws_send: Step 401 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.003] [info] ws_send: Step 402 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.005] [info] ws_send: Step 403 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.007] [info] ws_send: Step 404 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.009] [info] ws_send: Step 405 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.010] [info] ws_send: Step 406 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.012] [info] ws_send: Step 407 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.014] [info] ws_send: Step 408 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.016] [info] ws_send: Step 409 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.018] [info] ws_send: Step 410 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.020] [info] ws_send: Step 411 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.021] [info] ws_send: Step 412 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.023] [info] ws_send: Step 413 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.025] [info] ws_send: Step 414 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.027] [info] ws_send: Step 415 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.029] [info] ws_send: Step 416 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.030] [info] ws_send: Step 417 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.032] [info] ws_send: Step 418 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.034] [info] ws_send: Step 419 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.036] [info] ws_send: Step 420 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.038] [info] ws_send: Step 421 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.040] [info] ws_send: Step 422 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.041] [info] ws_send: Step 423 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.043] [info] ws_send: Step 424 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.045] [info] ws_send: Step 425 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.047] [info] ws_send: Step 426 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.049] [info] ws_send: Step 427 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.051] [info] ws_send: Step 428 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.052] [info] ws_send: Step 429 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.054] [info] ws_send: Step 430 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.056] [info] ws_send: Step 431 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.058] [info] ws_send: Step 432 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.060] [info] ws_send: Step 433 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.062] [info] ws_send: Step 434 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.063] [info] ws_send: Step 435 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.065] [info] ws_send: Step 436 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.067] [info] ws_send: Step 437 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.069] [info] ws_send: Step 438 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.071] [info] ws_send: Step 439 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.073] [info] ws_send: Step 440 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.075] [info] ws_send: Step 441 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.077] [info] ws_send: Step 442 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.078] [info] ws_send: Step 443 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.080] [info] ws_send: Step 444 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.082] [info] ws_send: Step 445 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.084] [info] ws_send: Step 446 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.086] [info] ws_send: Step 447 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.088] [info] ws_send: Step 448 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.090] [info] ws_send: Step 449 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.091] [info] ws_send: Step 450 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.093] [info] ws_send: Step 451 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.095] [info] ws_send: Step 452 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.097] [info] ws_send: Step 453 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.099] [info] ws_send: Step 454 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.101] [info] ws_send: Step 455 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.102] [info] ws_send: Step 456 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.104] [info] ws_send: Step 457 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.106] [info] ws_send: Step 458 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.108] [info] ws_send: Step 459 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.110] [info] ws_send: Step 460 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.112] [info] ws_send: Step 461 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.113] [info] ws_send: Step 462 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.115] [info] ws_send: Step 463 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.117] [info] ws_send: Step 464 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.119] [info] ws_send: Step 465 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.121] [info] ws_send: Step 466 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.123] [info] ws_send: Step 467 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.124] [info] ws_send: Step 468 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.126] [info] ws_send: Step 469 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.128] [info] ws_send: Step 470 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.130] [info] ws_send: Step 471 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.132] [info] ws_send: Step 472 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.134] [info] ws_send: Step 473 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.135] [info] ws_send: Step 474 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.137] [info] ws_send: Step 475 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.139] [info] ws_send: Step 476 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.141] [info] ws_send: Step 477 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.143] [info] ws_send: Step 478 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.145] [info] ws_send: Step 479 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.146] [info] ws_send: Step 480 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.148] [info] ws_send: Step 481 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.150] [info] ws_send: Step 482 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.152] [info] ws_send: Step 483 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.154] [info] ws_send: Step 484 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.155] [info] ws_send: Step 485 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.157] [info] ws_send: Step 486 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.159] [info] ws_send: Step 487 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.161] [info] ws_send: Step 488 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.163] [info] ws_send: Step 489 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.165] [info] ws_send: Step 490 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.166] [info] ws_send: Step 491 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.168] [info] ws_send: Step 492 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.170] [info] ws_send: Step 493 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.172] [info] ws_send: Step 494 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.174] [info] ws_send: Step 495 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.176] [info] ws_send: Step 496 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.177] [info] ws_send: Step 497 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.179] [info] ws_send: Step 498 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.181] [info] ws_send: Step 499 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.183] [info] ws_send: Step 500 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.185] [info] ws_send: Step 501 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.186] [info] ws_send: Step 502 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.188] [info] ws_send: Step 503 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.190] [info] ws_send: Step 504 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.192] [info] ws_send: Step 505 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.194] [info] ws_send: Step 506 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.196] [info] ws_send: Step 507 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.198] [info] ws_send: Step 508 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.199] [info] ws_send: Step 509 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.201] [info] ws_send: Step 510 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.203] [info] ws_send: Step 511 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.205] [info] ws_send: Step 512 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.207] [info] ws_send: Step 513 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.209] [info] ws_send: Step 514 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.210] [info] ws_send: Step 515 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.212] [info] ws_send: Step 516 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.214] [info] ws_send: Step 517 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.216] [info] ws_send: Step 518 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.218] [info] ws_send: Step 519 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.220] [info] ws_send: Step 520 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.221] [info] ws_send: Step 521 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.223] [info] ws_send: Step 522 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.225] [info] ws_send: Step 523 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.227] [info] ws_send: Step 524 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.229] [info] ws_send: Step 525 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.230] [info] ws_send: Step 526 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.232] [info] ws_send: Step 527 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.234] [info] ws_send: Step 528 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.236] [info] ws_send: Step 529 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.238] [info] ws_send: Step 530 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.240] [info] ws_send: Step 531 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.241] [info] ws_send: Step 532 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.243] [info] ws_send: Step 533 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.245] [info] ws_send: Step 534 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.247] [info] ws_send: Step 535 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.249] [info] ws_send: Step 536 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.250] [info] ws_send: Step 537 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.252] [info] ws_send: Step 538 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.254] [info] ws_send: Step 539 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.256] [info] ws_send: Step 540 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.258] [info] ws_send: Step 541 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.260] [info] ws_send: Step 542 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.261] [info] ws_send: Step 543 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.263] [info] ws_send: Step 544 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.265] [info] ws_send: Step 545 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.267] [info] ws_send: Step 546 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.269] [info] ws_send: Step 547 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.271] [info] ws_send: Step 548 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.272] [info] ws_send: Step 549 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.274] [info] ws_send: Step 550 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.276] [info] ws_send: Step 551 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.278] [info] ws_send: Step 552 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.280] [info] ws_send: Step 553 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.282] [info] ws_send: Step 554 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.283] [info] ws_send: Step 555 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.285] [info] ws_send: Step 556 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.287] [info] ws_send: Step 557 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.289] [info] ws_send: Step 558 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.291] [info] ws_send: Step 559 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.293] [info] ws_send: Step 560 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.294] [info] ws_send: Step 561 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.296] [info] ws_send: Step 562 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.298] [info] ws_send: Step 563 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.300] [info] ws_send: Step 564 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.302] [info] ws_send: Step 565 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.304] [info] ws_send: Step 566 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.305] [info] ws_send: Step 567 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.307] [info] ws_send: Step 568 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.309] [info] ws_send: Step 569 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.311] [info] ws_send: Step 570 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.313] [info] ws_send: Step 571 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.315] [info] ws_send: Step 572 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.316] [info] ws_send: Step 573 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.318] [info] ws_send: Step 574 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.320] [info] ws_send: Step 575 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.322] [info] ws_send: Step 576 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.324] [info] ws_send: Step 577 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.326] [info] ws_send: Step 578 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.327] [info] ws_send: Step 579 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.329] [info] ws_send: Step 580 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.331] [info] ws_send: Step 581 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.333] [info] ws_send: Step 582 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.335] [info] ws_send: Step 583 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.337] [info] ws_send: Step 584 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.338] [info] ws_send: Step 585 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.340] [info] ws_send: Step 586 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.342] [info] ws_send: Step 587 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.344] [info] ws_send: Step 588 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.346] [info] ws_send: Step 589 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.347] [info] ws_send: Step 590 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.349] [info] ws_send: Step 591 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.351] [info] ws_send: Step 592 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.353] [info] ws_send: Step 593 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.355] [info] ws_send: Step 594 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.357] [info] ws_send: Step 595 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.359] [info] ws_send: Step 596 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.360] [info] ws_send: Step 597 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.362] [info] ws_send: Step 598 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.364] [info] ws_send: Step 599 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.366] [info] ws_send: Step 600 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.368] [info] ws_send: Step 601 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.370] [info] ws_send: Step 602 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.371] [info] ws_send: Step 603 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.373] [info] ws_send: Step 604 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.375] [info] ws_send: Step 605 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.377] [info] ws_send: Step 606 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.379] [info] ws_send: Step 607 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.381] [info] ws_send: Step 608 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.382] [info] ws_send: Step 609 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.384] [info] ws_send: Step 610 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.386] [info] ws_send: Step 611 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.388] [info] ws_send: Step 612 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.390] [info] ws_send: Step 613 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.392] [info] ws_send: Step 614 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.393] [info] ws_send: Step 615 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.395] [info] ws_send: Step 616 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.397] [info] ws_send: Step 617 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.399] [info] ws_send: Step 618 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.401] [info] ws_send: Step 619 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.403] [info] ws_send: Step 620 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.404] [info] ws_send: Step 621 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.406] [info] ws_send: Step 622 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.408] [info] ws_send: Step 623 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.410] [info] ws_send: Step 624 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.412] [info] ws_send: Step 625 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.414] [info] ws_send: Step 626 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.415] [info] ws_send: Step 627 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.417] [info] ws_send: Step 628 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.419] [info] ws_send: Step 629 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.421] [info] ws_send: Step 630 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.423] [info] ws_send: Step 631 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.425] [info] ws_send: Step 632 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.427] [info] ws_send: Step 633 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.428] [info] ws_send: Step 634 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.430] [info] ws_send: Step 635 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.432] [info] ws_send: Step 636 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.434] [info] ws_send: Step 637 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.436] [info] ws_send: Step 638 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.438] [info] ws_send: Step 639 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.439] [info] ws_send: Step 640 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.441] [info] ws_send: Step 641 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.443] [info] ws_send: Step 642 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.445] [info] ws_send: Step 643 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.447] [info] ws_send: Step 644 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.449] [info] ws_send: Step 645 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.450] [info] ws_send: Step 646 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.452] [info] ws_send: Step 647 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.454] [info] ws_send: Step 648 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.456] [info] ws_send: Step 649 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.458] [info] ws_send: Step 650 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.460] [info] ws_send: Step 651 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.461] [info] ws_send: Step 652 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.463] [info] ws_send: Step 653 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.465] [info] ws_send: Step 654 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.467] [info] ws_send: Step 655 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.469] [info] ws_send: Step 656 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.471] [info] ws_send: Step 657 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.472] [info] ws_send: Step 658 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.474] [info] ws_send: Step 659 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.476] [info] ws_send: Step 660 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.478] [info] ws_send: Step 661 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.480] [info] ws_send: Step 662 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.482] [info] ws_send: Step 663 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.483] [info] ws_send: Step 664 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.485] [info] ws_send: Step 665 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.487] [info] ws_send: Step 666 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.489] [info] ws_send: Step 667 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.491] [info] ws_send: Step 668 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.493] [info] ws_send: Step 669 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.494] [info] ws_send: Step 670 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.496] [info] ws_send: Step 671 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.498] [info] ws_send: Step 672 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.500] [info] ws_send: Step 673 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.502] [info] ws_send: Step 674 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.503] [info] ws_send: Step 675 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.505] [info] ws_send: Step 676 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.507] [info] ws_send: Step 677 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.509] [info] ws_send: Step 678 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.511] [info] ws_send: Step 679 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.513] [info] ws_send: Step 680 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.514] [info] ws_send: Step 681 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.516] [info] ws_send: Step 682 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.518] [info] ws_send: Step 683 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.520] [info] ws_send: Step 684 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.522] [info] ws_send: Step 685 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.524] [info] ws_send: Step 686 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.525] [info] ws_send: Step 687 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.527] [info] ws_send: Step 688 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.529] [info] ws_send: Step 689 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.531] [info] ws_send: Step 690 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.533] [info] ws_send: Step 691 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.535] [info] ws_send: Step 692 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.536] [info] ws_send: Step 693 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.538] [info] ws_send: Step 694 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.540] [info] ws_send: Step 695 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.542] [info] ws_send: Step 696 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.544] [info] ws_send: Step 697 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.545] [info] ws_send: Step 698 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.547] [info] ws_send: Step 699 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.549] [info] ws_send: Step 700 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.551] [info] ws_send: Step 701 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.553] [info] ws_send: Step 702 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.555] [info] ws_send: Step 703 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.556] [info] ws_send: Step 704 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.558] [info] ws_send: Step 705 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.560] [info] ws_send: Step 706 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.562] [info] ws_send: Step 707 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.564] [info] ws_send: Step 708 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.566] [info] ws_send: Step 709 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.567] [info] ws_send: Step 710 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.569] [info] ws_send: Step 711 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.571] [info] ws_send: Step 712 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.573] [info] ws_send: Step 713 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.575] [info] ws_send: Step 714 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.576] [info] ws_send: Step 715 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.578] [info] ws_send: Step 716 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.580] [info] ws_send: Step 717 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.582] [info] ws_send: Step 718 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.584] [info] ws_send: Step 719 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.586] [info] ws_send: Step 720 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.587] [info] ws_send: Step 721 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.589] [info] ws_send: Step 722 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.591] [info] ws_send: Step 723 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.593] [info] ws_send: Step 724 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.595] [info] ws_send: Step 725 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.597] [info] ws_send: Step 726 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.598] [info] ws_send: Step 727 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.600] [info] ws_send: Step 728 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.602] [info] ws_send: Step 729 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.604] [info] ws_send: Step 730 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.606] [info] ws_send: Step 731 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.607] [info] ws_send: Step 732 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.609] [info] ws_send: Step 733 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.611] [info] ws_send: Step 734 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.613] [info] ws_send: Step 735 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.615] [info] ws_send: Step 736 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.617] [info] ws_send: Step 737 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.618] [info] ws_send: Step 738 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.620] [info] ws_send: Step 739 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.622] [info] ws_send: Step 740 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.624] [info] ws_send: Step 741 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.626] [info] ws_send: Step 742 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.628] [info] ws_send: Step 743 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.630] [info] ws_send: Step 744 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.632] [info] ws_send: Step 745 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.633] [info] ws_send: Step 746 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.635] [info] ws_send: Step 747 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.637] [info] ws_send: Step 748 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.639] [info] ws_send: Step 749 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.641] [info] ws_send: Step 750 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.642] [info] ws_send: Step 751 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.644] [info] ws_send: Step 752 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.646] [info] ws_send: Step 753 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.648] [info] ws_send: Step 754 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.650] [info] ws_send: Step 755 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.652] [info] ws_send: Step 756 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.653] [info] ws_send: Step 757 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.655] [info] ws_send: Step 758 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.657] [info] ws_send: Step 759 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.659] [info] ws_send: Step 760 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.661] [info] ws_send: Step 761 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.662] [info] ws_send: Step 762 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.664] [info] ws_send: Step 763 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.666] [info] ws_send: Step 764 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.668] [info] ws_send: Step 765 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.670] [info] ws_send: Step 766 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.673] [info] ws_send: Step 767 out of 768
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.676] [info] ws_send: 0 bytes left to be sent
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.689] [info] Sending file through websocket completed in 1801
|
||||
15:29:55 send.1 | [2020-01-05 15:29:55.689] [info] ws_send: Send transfer rate: 13 MB/s
|
||||
15:29:56 send.1 | [2020-01-05 15:29:56.142] [info] ws_send: Waiting for ack...
|
||||
15:29:57 send.1 | [2020-01-05 15:29:57.399] [info] ws_send: received message (25183026 bytes)
|
||||
15:29:57 send.1 | [2020-01-05 15:29:57.399] [info] ws_send: Done !
|
||||
15:29:59 send.1 | [2020-01-05 15:29:59.233] [info] ws_send: connection closed: code 1000 reason Normal closure
|
||||
15:29:59 send.1 |
|
||||
15:29:59 system | send.1 stopped (rc=0)
|
||||
15:29:59 system | sending SIGTERM to nginx.1 (pid 75372)
|
||||
15:29:59 system | sending SIGTERM to websocket_server.1 (pid 75374)
|
||||
15:29:59 system | nginx.1 stopped (rc=0)
|
||||
15:29:59 system | websocket_server.1 stopped (rc=-15)
|
||||
```
|
||||
|
||||
## Sending large files over SSL
|
||||
|
||||
Running inside docker
|
||||
|
||||
```
|
||||
$ make docker && make server_ssl
|
||||
```
|
||||
|
||||
On the client
|
||||
|
||||
```
|
||||
$ make ws_mbedtls && cp build/ws/ws /usr/local/bin/ws && ws send --verify_none wss://localhost:8766 /tmp/big_file
|
||||
```
|
||||
|
@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# WS server example
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import websockets
|
||||
|
||||
|
||||
clients = set()
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
clients.add(websocket)
|
||||
|
||||
try:
|
||||
while True:
|
||||
msg = await websocket.recv()
|
||||
|
||||
for ws in clients:
|
||||
if ws != websocket:
|
||||
print(f'Sending {len(msg)} bytes to {ws}')
|
||||
await ws.send(msg)
|
||||
except websockets.exceptions.ConnectionClosedOK:
|
||||
print('Client terminating')
|
||||
clients.remove(websocket)
|
||||
|
||||
|
||||
host = os.getenv('BIND_HOST', 'localhost')
|
||||
print(f'Serving on {host}:8766')
|
||||
|
||||
start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# WS server example
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import pathlib
|
||||
import ssl
|
||||
import websockets
|
||||
|
||||
|
||||
clients = set()
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
clients.add(websocket)
|
||||
|
||||
try:
|
||||
while True:
|
||||
msg = await websocket.recv()
|
||||
|
||||
for ws in clients:
|
||||
if ws != websocket:
|
||||
print(f'Sending {len(msg)} bytes to {ws}')
|
||||
await ws.send(msg)
|
||||
except websockets.exceptions.ConnectionClosedOK:
|
||||
print('Client terminating')
|
||||
clients.remove(websocket)
|
||||
|
||||
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
ssl_context.load_cert_chain('trusted-server-crt.pem',
|
||||
'trusted-server-key.pem')
|
||||
|
||||
host = os.getenv('BIND_HOST', 'localhost')
|
||||
print(f'Serving on {host}:8766')
|
||||
|
||||
start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30, ssl=ssl_context)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
||||
|
@ -3,19 +3,20 @@
|
||||
# WS server example
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import websockets
|
||||
|
||||
async def hello(websocket, path):
|
||||
await websocket.send(f"> Welcome !")
|
||||
|
||||
async def echo(websocket, path):
|
||||
msg = await websocket.recv()
|
||||
print(f'Received {len(msg)} bytes')
|
||||
await websocket.send(msg)
|
||||
name = await websocket.recv()
|
||||
print(f"< {name}")
|
||||
|
||||
host = os.getenv('BIND_HOST', 'localhost')
|
||||
print(f'Serving on {host}:8766')
|
||||
greeting = f"Hello {name}!"
|
||||
|
||||
start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30)
|
||||
await websocket.send(greeting)
|
||||
print(f"> {greeting}")
|
||||
|
||||
start_server = websockets.serve(hello, 'localhost', 8765)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# WS server example
|
||||
|
||||
import asyncio
|
||||
import websockets
|
||||
|
||||
async def hello(websocket, path):
|
||||
await websocket.send(f"> Welcome !")
|
||||
|
||||
name = await websocket.recv()
|
||||
print(f"< {name}")
|
||||
|
||||
greeting = f"Hello {name}!"
|
||||
|
||||
await websocket.send(greeting)
|
||||
print(f"> {greeting}")
|
||||
|
||||
async def echo(websocket, path):
|
||||
msg = await websocket.recv()
|
||||
print(f'Received {len(msg)} bytes')
|
||||
await websocket.send(msg)
|
||||
|
||||
print('Serving on localhost:8766')
|
||||
start_server = websockets.serve(echo, 'localhost', 8766)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# WS server example
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import pathlib
|
||||
import ssl
|
||||
import websockets
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
msg = await websocket.recv()
|
||||
print(f'Received {len(msg)} bytes')
|
||||
await websocket.send(msg)
|
||||
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
ssl_context.load_cert_chain('trusted-server-crt.pem',
|
||||
'trusted-server-key.pem')
|
||||
|
||||
host = os.getenv('BIND_HOST', 'localhost')
|
||||
print(f'Serving on {host}:8766')
|
||||
|
||||
start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30, ssl=ssl_context)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $MODE in
|
||||
echo_server)
|
||||
python /usr/bin/echo_server.py
|
||||
;;
|
||||
echo_server_ssl)
|
||||
python /usr/bin/echo_server_ssl.py
|
||||
;;
|
||||
broadcast_server)
|
||||
python /usr/bin/broadcast_server.py
|
||||
;;
|
||||
broadcast_server_ssl)
|
||||
python /usr/bin/broadcast_server_ssl.py
|
||||
;;
|
||||
esac
|
@ -1 +0,0 @@
|
||||
trusted-client-crt.pem
|
@ -1,9 +1,6 @@
|
||||
all:
|
||||
honcho start # install honcho (pip install honcho) or procman (the original ruby script)
|
||||
|
||||
.PHONY: docker
|
||||
|
||||
NAME := bsergean/echo_server
|
||||
NAME := bsergean/ws_proxy
|
||||
TAG := $(shell cat DOCKER_VERSION)
|
||||
IMG := ${NAME}:${TAG}
|
||||
LATEST := ${NAME}:latest
|
||||
@ -21,15 +18,3 @@ docker_push:
|
||||
docker tag ${IMG} ${LATEST}
|
||||
docker push ${LATEST}
|
||||
docker push ${IMG}
|
||||
|
||||
echo_server:
|
||||
docker run -p 8766:8766 -e BIND_HOST=0.0.0.0 -e MODE=echo_server -it --rm bsergean/echo_server:build
|
||||
|
||||
echo_server_ssl:
|
||||
docker run -p 8766:8766 -e BIND_HOST=0.0.0.0 -e MODE=echo_server_ssl -it --rm bsergean/echo_server:build
|
||||
|
||||
broadcast_server:
|
||||
docker run -p 8766:8766 -e BIND_HOST=0.0.0.0 -e MODE=broadcast_server -it --rm bsergean/echo_server:build
|
||||
|
||||
broadcast_server_ssl:
|
||||
docker run -p 8766:8766 -e BIND_HOST=0.0.0.0 -e MODE=broadcast_server_ssl -it --rm bsergean/echo_server:build
|
||||
|
@ -1,36 +0,0 @@
|
||||
|
||||
error_log stderr warn;
|
||||
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
worker_connections 32;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
upstream websocket {
|
||||
server localhost:8766;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8765 ssl;
|
||||
|
||||
ssl_certificate trusted-client-crt.pem;
|
||||
ssl_certificate_key trusted-client-key.pem;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://websocket;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
not much in here
|
@ -1,19 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDLDCCAhSgAwIBAgIJALyEpMxNH62gMA0GCSqGSIb3DQEBCwUAMEExFDASBgNV
|
||||
BAoMC21hY2hpbmV6b25lMRQwEgYDVQQKDAtJWFdlYlNvY2tldDETMBEGA1UEAwwK
|
||||
dHJ1c3RlZC1jYTAeFw0xOTEyMjQwMDM3MzVaFw0yMDEyMjMwMDM3MzVaMEUxFDAS
|
||||
BgNVBAoMC21hY2hpbmV6b25lMRQwEgYDVQQKDAtJWFdlYlNvY2tldDEXMBUGA1UE
|
||||
AwwOdHJ1c3RlZC1jbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
||||
AQDFCipQ6OIJX15n2okHxuSkviuzcHzoYEzPhF6QXzKFbKhuzp4g0mMOXPvDKQE+
|
||||
+dycGm6l1yg1pUuNKNxYjDWcSqOIqvDaOv9DkJCCNXpAGbh1CUmGdmp4HvwrzSIn
|
||||
+3s/enC+zatcnwhrOyJk8k/9VqKlt+vB1++UAQV1eSX7adb/BemoyMguAQ8edAls
|
||||
IiVSRrHRRyHy98j97jxX5lIdoC1FMv7Tj4suJA7wvTHlq3clpLL8t6dw1DAmBybK
|
||||
ShUg9SC/T07WJ2cOo8wka+p7S/blh8qZwIy7kTgCI+SYgRfEOA94u9A9mDqp295h
|
||||
DCghN2UdU3hh1k7SChI/owLpAgMBAAGjIzAhMB8GA1UdEQQYMBaCCWxvY2FsaG9z
|
||||
dIIJMTI3LjAuMC4xMA0GCSqGSIb3DQEBCwUAA4IBAQAtsbBGLUxABNH5yoRbk0o3
|
||||
sGFMVkNDKkCE24BVkUfNyKUxLQWMknw3B4bmhrC8ZQPRk069ERV0ZR6eB2/9EG9s
|
||||
Pzy4JbMwWrP5c0UIMJRk3w8ev9FXrsKwG6VhIPnvAdbJEis+7eDmYgpvmsbsYRmG
|
||||
cqJcWvDKffki52Gbr9WgxLpqCGc2XMGr1Y1jU73Y4zmOeNLiU6HRKimNtGjqx/Tx
|
||||
QoGVTNwki4TQTwQIyJ+HOj0c49IDJ93GbW5aymOT/e1IXDe07e9yg1r80bdFn23X
|
||||
9bmRagT1/qu8lXfOpQA0foYeSJRSN7gITPmo7G2ogGVr6dZwhAHDYYy2pwW32j7o
|
||||
-----END CERTIFICATE-----
|
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAxQoqUOjiCV9eZ9qJB8bkpL4rs3B86GBMz4RekF8yhWyobs6e
|
||||
INJjDlz7wykBPvncnBpupdcoNaVLjSjcWIw1nEqjiKrw2jr/Q5CQgjV6QBm4dQlJ
|
||||
hnZqeB78K80iJ/t7P3pwvs2rXJ8IazsiZPJP/VaipbfrwdfvlAEFdXkl+2nW/wXp
|
||||
qMjILgEPHnQJbCIlUkax0Uch8vfI/e48V+ZSHaAtRTL+04+LLiQO8L0x5at3JaSy
|
||||
/LencNQwJgcmykoVIPUgv09O1idnDqPMJGvqe0v25YfKmcCMu5E4AiPkmIEXxDgP
|
||||
eLvQPZg6qdveYQwoITdlHVN4YdZO0goSP6MC6QIDAQABAoIBAGMCJ58+Vg5FmKdw
|
||||
vThmLY/GaykgVfNiKFaB+g5rd3Rp0/zR3804SkP2Xx+CpDijzsG12nGEupSyOVN1
|
||||
+7qWwX2GV8QduSa/THMD2klDW+mHwxM0Fnj1WayATVApJIeYqyaLfMmziO7ijpVr
|
||||
Qm4dACqZdOL2lwVxXtYs6TRNKtO4SIzmeVS39hmV2zeGmhUzI4hbirLOWBtbsPpl
|
||||
qi5wyVkHoEVLnY376TOFc8u5+636yh6G2yqa/zsv9BBXG77DKWl659Fsd4DaUcRG
|
||||
sk6CTH+I99aE0wrzSUuQmDR/IflxT+DP2ceNrCIc1h1oFzrBKh3fpFR3+D6SSGMn
|
||||
r9Nk7LECgYEA/8CHrh2LLjqsLbqBoMUXthPwPrVGlK+KGb14+S8Pbfa2hDFWhoif
|
||||
/FBWAD7GSXedjL3kxFSfmFxsDGPSyqqLRuZNaNs8Ar7vage6FYT6Vfh/8TYOToNr
|
||||
8AHmhgQCg4luC8VGedCeEDVmUgkdJd/baoY8r3LKXaqsLxyBQN1Hzi0CgYEAxTsQ
|
||||
jMFwACIdZHJKgUAdEA6PJM0HCS45F4116yqum99S4H10O1VdWK/vKeb13PK//25X
|
||||
liXhjNHqcVLX08meqs561nKBWhbA72UU3oBAF4RNLHkbZMh1HtZGfBCfJ/Kmq12/
|
||||
ZmGCwggUHhwnKD02hIGdffc+0eLTeCQL8HKi+S0CgYEA59+MpAXRHDbByCviPvqy
|
||||
hrgJBzGfLksAsFmihnluScp2q993jT3tnvrPHiXL7OvwAZxg/seicqbIp2sRwAFj
|
||||
iQJgiILMI8kskzsyMTSBKtTEWtMhoXlxsQZoFHUqOkutZCqVvPexdwyTGil9LcuJ
|
||||
yUivWHqAku+ccJItdbup0HkCgYEAswkZzdvucoCFU+AX19o+R4wfzpU7FM9bzhCA
|
||||
gTgehqojzlqzfwTPlqkmHlBk0Oue9BzS7x5172HCQpqkBsGYAY8rnK0W1JOhEe8d
|
||||
EZk0FOTpNTy+bC83egWiuA5Sm22+dALGswZDLyUsNeTyeqmOapxKPcWJxfb0ZbO7
|
||||
DsrRPAUCgYAzJm79VvEeRtwKhm0AcDSikJgNKojm6T6BIi/9QJyMTYlvGpBEwPBt
|
||||
iqmqCqXGmUYafFApTUPyzmyDUsLfeHRwylvPn4UtYXPJ1UKGCVY3SWiJQi2CHSvC
|
||||
gGSIifjzyeSjhw1cqzS2jHfu4lu6p2GBv/fyXLRVS7x6xY7OBinmvg==
|
||||
-----END RSA PRIVATE KEY-----
|
@ -1,19 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDLDCCAhSgAwIBAgIJALyEpMxNH62fMA0GCSqGSIb3DQEBCwUAMEExFDASBgNV
|
||||
BAoMC21hY2hpbmV6b25lMRQwEgYDVQQKDAtJWFdlYlNvY2tldDETMBEGA1UEAwwK
|
||||
dHJ1c3RlZC1jYTAeFw0xOTEyMjQwMDM3MzVaFw0yMDEyMjMwMDM3MzVaMEUxFDAS
|
||||
BgNVBAoMC21hY2hpbmV6b25lMRQwEgYDVQQKDAtJWFdlYlNvY2tldDEXMBUGA1UE
|
||||
AwwOdHJ1c3RlZC1zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
||||
AQCv0T68TZZ7nab+UWPhssGLrInE0egzWn1AF20RkJv1ePIyU0rQbDxuuP+HQbXD
|
||||
FzF6vo2j+5p+VxxvUOfko9V6xad3cB4T3AoFrT5sYI8gQX1uby6pjqVX16TK5t+c
|
||||
i56aNhUXdmcWhuUzlIMIauvueohd+pNj6E6weWqCf8QFD6KYPgK3wWCR4VfWA5QY
|
||||
RJUhv2aI9HrC9P4Mg0mut8LYURRQvGxOhtbAw76FJ6IgBujpgI5GLHgVK5Q1GlXK
|
||||
8W7RlNKNmxX+mzK2D6nHixCUGvrFk9nZgZiaHI/h5x0IGXu0sbwlTPjqQ4Axpofw
|
||||
G1FDi/er4FaGCzU4CKmc7rxRAgMBAAGjIzAhMB8GA1UdEQQYMBaCCWxvY2FsaG9z
|
||||
dIIJMTI3LjAuMC4xMA0GCSqGSIb3DQEBCwUAA4IBAQBkUB6smmApnBfr2eDwKJew
|
||||
GQUMUAa7TlyANYlwQ6EjbAH7H6oNf7Sm63Go2Y72JjZPw3OvZl3QcvvS14QxYJ71
|
||||
kRdvJ1mhEbIaA2QkdZCuDmcQGLfVEyo0j5q03amQKt9QtSv9MsX1Ok2HqGL17Tf1
|
||||
QiUqlkzGCqMIsU20X8QzqwYCGzYZeTFtwLYi75za15Uo/6tE2KwzU7oUhuIebOaS
|
||||
Sa+s2Y1TjpbWyw9usnuQWQ0k1FJR78F1mKJGghmPBoySBHJdLkLYOMhE1u2shgk5
|
||||
N0muMcDRTeHLxm1aBPLHtkRbW3QscEQB6GkT2Dt4U66qNV2CY7Gk0F5xxOrGBC/9
|
||||
-----END CERTIFICATE-----
|
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAr9E+vE2We52m/lFj4bLBi6yJxNHoM1p9QBdtEZCb9XjyMlNK
|
||||
0Gw8brj/h0G1wxcxer6No/uaflccb1Dn5KPVesWnd3AeE9wKBa0+bGCPIEF9bm8u
|
||||
qY6lV9ekyubfnIuemjYVF3ZnFoblM5SDCGrr7nqIXfqTY+hOsHlqgn/EBQ+imD4C
|
||||
t8FgkeFX1gOUGESVIb9miPR6wvT+DINJrrfC2FEUULxsTobWwMO+hSeiIAbo6YCO
|
||||
Rix4FSuUNRpVyvFu0ZTSjZsV/psytg+px4sQlBr6xZPZ2YGYmhyP4ecdCBl7tLG8
|
||||
JUz46kOAMaaH8BtRQ4v3q+BWhgs1OAipnO68UQIDAQABAoIBAG/bIR2uAyJMT7UX
|
||||
VQN/tbFGKTRmE2Owm2UOQl7dcMvAkd5AraViZyROYIvN23TuKZWc7AI7DbR5eWa8
|
||||
w3vsW+JLI9tSImCiKmIoMUHEQOrVn5aF99r6HOmBEZ/hOLyg+1vDMrIFq1pioimp
|
||||
v5+4XrgPjvizddgnMQEHjiLOZIiOtin+alixN/W41Ij0jOtRycM5wq3Xr/0RAs5A
|
||||
ziNeQvWdvDwqa6L9upHZpFfYqP/+KflJPlHLfEkBHZtZQF3uy5tQ1VusfVMO3Xvb
|
||||
Ljk6RBnD9dKayreD9NVzotr36zYEy/V1oGJcP/8AD1xmDA0/2Kb+bfm+WQHG5wp6
|
||||
o09zsZECgYEA5Y3d79Nrfi6InVaZ0r5Y+XXqSZFTsgFnxRseVEbuK4jvrh7eC9jW
|
||||
pWoaXDh8W6RoT59BPSCKtbQ9mjdECh+aJ6MOeCzCiGSppJboOhC1iVFqFuQLDRO7
|
||||
w+2NgkhOvNnJJJYmdTwfokTLmaRUiNqwWAtBm+h7py9e5eXujzqt4+UCgYEAxBKL
|
||||
OO8CWRb0yGlwKoCwYgGCsVauvbZHaELOAKJUB6H+YhZ+SJqd915u8aYs5nbcMyne
|
||||
5kuewzd+32WpkykI0Fz4SrGvDETKB5/Yynblp9m69LNdgYoVWgQqQocXVw0nD/nA
|
||||
KQdFSBZZRExXC/aUAa55txFJitMC4FjgTENgR/0CgYAS/OonxVg15sl8Ika1DPO1
|
||||
JtDLZw8CQWWBA1494GQhC8GvqHP7jOMsaZtml3GJ7w6Fz4mI8eEnaJJT6FBjefu5
|
||||
XZ57yFALEjCKIcVx0CIECsz4ucJEQaadbU/wP+TrcCRYN2dU+TUwqfohaltnupct
|
||||
oTi7Gb7otF1oLN3P0S3DFQKBgEnVjdXPszunOGBrzBBFS6ZsWTG8qarJBFTPq1Fz
|
||||
z17ccrWvMLjYeJnZVr/qyseyhLNDlit02IE82ar4VoYTEr2b9Ofzxy5AjS+X0wRT
|
||||
B6JQjGVvUcvhGq8+GEfbJT/jtQ0ACIuqsD04JT9h2/mmTg/gCveUK/R6B4BCF5zA
|
||||
VnZlAoGBANOG5T7KsOH+Hbb//dEmfZYMQmkO/+1Pac9eP4uDFNAVF00M6XHf5LrR
|
||||
gRp5t46drDtLgxdufN0oUItp8y74EuMa9FHlBQVZRaSqYF4bCgf2PieGApbKWG2n
|
||||
QhnxYfZqf9S2oVK95EHiJxmtumOFBL7YI9NdzNEeoJExS5Bw6kUn
|
||||
-----END RSA PRIVATE KEY-----
|
1432
test/compatibility/python/websockets/vendor/protocol.py
vendored
1432
test/compatibility/python/websockets/vendor/protocol.py
vendored
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# websocket send client
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import websockets
|
||||
|
||||
|
||||
async def send(url, path):
|
||||
async with websockets.connect(url, ping_timeout=None, ping_interval=None) as ws:
|
||||
with open(path, 'rb') as f:
|
||||
message = f.read()
|
||||
|
||||
print('Sending message...')
|
||||
await ws.send(message)
|
||||
print('Message sent.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='websocket proxy.')
|
||||
parser.add_argument('--path', help='Path to the file to send.',
|
||||
default='small_file')
|
||||
parser.add_argument('--url', help='Remote websocket url',
|
||||
default='wss://echo.websocket.org')
|
||||
args = parser.parse_args()
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(send(args.url, args.path))
|
97
third_party/spdlog/CMakeLists.txt
vendored
97
third_party/spdlog/CMakeLists.txt
vendored
@ -63,43 +63,31 @@ option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF)
|
||||
# install options
|
||||
option(SPDLOG_INSTALL "Generate the install target" ${SPDLOG_MASTER_PROJECT})
|
||||
option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF)
|
||||
option(SPDLOG_FMT_EXTERNAL_HO "Use external fmt header-only library instead of bundled" OFF)
|
||||
|
||||
if(WIN32)
|
||||
option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF)
|
||||
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
||||
endif()
|
||||
|
||||
option(SPDLOG_NO_EXCEPTIONS "Compile with -fno-exceptions. Call abort() on any spdlog exceptions" OFF)
|
||||
|
||||
if (SPDLOG_FMT_EXTERNAL AND SPDLOG_FMT_EXTERNAL_HO)
|
||||
message(FATAL_ERROR "SPDLOG_FMT_EXTERNAL and SPDLOG_FMT_EXTERNAL_HO are mutually exclusive")
|
||||
endif()
|
||||
|
||||
# misc tweakme options
|
||||
if(WIN32)
|
||||
option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF)
|
||||
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
option(SPDLOG_CLOCK_COARSE "Use the much faster (but much less accurate) CLOCK_REALTIME_COARSE instead of the regular clock," OFF)
|
||||
endif()
|
||||
|
||||
option(SPDLOG_PREVENT_CHILD_FD "Prevent from child processes to inherit log file descriptors" OFF)
|
||||
option(SPDLOG_NO_THREAD_ID "prevent spdlog from querying the thread id on each log call if thread id is not needed" OFF)
|
||||
option(SPDLOG_NO_TLS "prevent spdlog from using thread local storage" OFF)
|
||||
option(SPDLOG_NO_ATOMIC_LEVELS "prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently" OFF)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Static/Shared library (shared not supported in windows yet)
|
||||
#---------------------------------------------------------------------------------------
|
||||
set(SPDLOG_SRCS
|
||||
src/spdlog.cpp
|
||||
src/stdout_sinks.cpp
|
||||
src/fmt.cpp
|
||||
src/color_sinks.cpp
|
||||
src/file_sinks.cpp
|
||||
src/async.cpp)
|
||||
|
||||
|
||||
if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
|
||||
list(APPEND SPDLOG_SRCS src/fmt.cpp)
|
||||
endif()
|
||||
set(SPDLOG_CFLAGS "${PROJECT_NAME}")
|
||||
|
||||
if (SPDLOG_BUILD_SHARED)
|
||||
if(WIN32)
|
||||
@ -135,30 +123,22 @@ target_link_libraries(spdlog_header_only INTERFACE Threads::Threads)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Use fmt package if using external fmt
|
||||
# Use fmt package if using exertnal fmt
|
||||
#---------------------------------------------------------------------------------------
|
||||
if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO)
|
||||
if(SPDLOG_FMT_EXTERNAL)
|
||||
if (NOT TARGET fmt::fmt)
|
||||
find_package(fmt REQUIRED)
|
||||
endif ()
|
||||
|
||||
set(SPDLOG_CFLAGS "${SPDLOG_CFLAGS} -DSPDLOG_FMT_EXTERNAL")
|
||||
|
||||
target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL)
|
||||
target_link_libraries(spdlog PUBLIC fmt::fmt)
|
||||
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL)
|
||||
|
||||
# use external fmt-header-nly
|
||||
if(SPDLOG_FMT_EXTERNAL_HO)
|
||||
target_link_libraries(spdlog PUBLIC fmt::fmt-header-only)
|
||||
target_link_libraries(spdlog_header_only INTERFACE fmt::fmt-header-only)
|
||||
else() # use external compile fmt
|
||||
target_link_libraries(spdlog PUBLIC fmt::fmt)
|
||||
target_link_libraries(spdlog_header_only INTERFACE fmt::fmt)
|
||||
endif()
|
||||
|
||||
set(PKG_CONFIG_REQUIRES fmt) # add dependency to pkg-config
|
||||
target_link_libraries(spdlog_header_only INTERFACE fmt::fmt)
|
||||
endif()
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Misc definitions according to tweak options
|
||||
#---------------------------------------------------------------------------------------
|
||||
if(SPDLOG_WCHAR_SUPPORT)
|
||||
target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||
@ -179,31 +159,6 @@ if(SPDLOG_WCHAR_SUPPORT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SPDLOG_CLOCK_COARSE)
|
||||
target_compile_definitions(spdlog PRIVATE SPDLOG_CLOCK_COARSE)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_CLOCK_COARSE)
|
||||
endif()
|
||||
|
||||
if(SPDLOG_PREVENT_CHILD_FD)
|
||||
target_compile_definitions(spdlog PRIVATE SPDLOG_PREVENT_CHILD_FD)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_PREVENT_CHILD_FD)
|
||||
endif()
|
||||
|
||||
if(SPDLOG_NO_THREAD_ID)
|
||||
target_compile_definitions(spdlog PRIVATE SPDLOG_NO_THREAD_ID)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_THREAD_ID)
|
||||
endif()
|
||||
|
||||
if(SPDLOG_NO_TLS)
|
||||
target_compile_definitions(spdlog PRIVATE SPDLOG_NO_TLS)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_TLS)
|
||||
endif()
|
||||
|
||||
if(SPDLOG_NO_ATOMIC_LEVELS)
|
||||
target_compile_definitions(spdlog PUBLIC SPDLOG_NO_ATOMIC_LEVELS)
|
||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_ATOMIC_LEVELS)
|
||||
endif()
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Build binaries
|
||||
@ -233,7 +188,7 @@ if (SPDLOG_INSTALL)
|
||||
set(project_config_out "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfig.cmake")
|
||||
set(config_targets_file "spdlogConfigTargets.cmake")
|
||||
set(version_config_file "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfigVersion.cmake")
|
||||
set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/spdlog")
|
||||
set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/spdlog/cmake")
|
||||
set(pkgconfig_install_dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
set(pkg_config "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")
|
||||
|
||||
@ -241,25 +196,19 @@ if (SPDLOG_INSTALL)
|
||||
# Include files
|
||||
#---------------------------------------------------------------------------------------
|
||||
install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "fmt/bundled" EXCLUDE)
|
||||
install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}/spdlog")
|
||||
|
||||
if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
|
||||
if(NOT SPDLOG_FMT_EXTERNAL)
|
||||
install(DIRECTORY include/${PROJECT_NAME}/fmt/bundled/
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/fmt/bundled/")
|
||||
endif()
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Install pkg-config file
|
||||
# Package and version files
|
||||
#---------------------------------------------------------------------------------------
|
||||
get_target_property(PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS)
|
||||
string(REPLACE ";" " -D" PKG_CONFIG_DEFINES "${PKG_CONFIG_DEFINES}")
|
||||
string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}")
|
||||
configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY)
|
||||
install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}")
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
# Install CMake config files
|
||||
#---------------------------------------------------------------------------------------
|
||||
install(EXPORT spdlog
|
||||
DESTINATION ${export_dest_dir}
|
||||
NAMESPACE spdlog::
|
||||
@ -267,7 +216,6 @@ if (SPDLOG_INSTALL)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file("${project_config_in}" "${project_config_out}" @ONLY)
|
||||
|
||||
write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion)
|
||||
install(FILES
|
||||
"${project_config_out}"
|
||||
@ -279,4 +227,3 @@ if (SPDLOG_INSTALL)
|
||||
include(cmake/spdlogCPack.cmake)
|
||||
|
||||
endif ()
|
||||
|
||||
|
2
third_party/spdlog/README.md
vendored
2
third_party/spdlog/README.md
vendored
@ -30,8 +30,6 @@ $ cmake .. && make -j
|
||||
* Gentoo: `emerge dev-libs/spdlog`
|
||||
* Arch Linux: `yaourt -S spdlog-git`
|
||||
* vcpkg: `vcpkg install spdlog`
|
||||
* conan: `spdlog/[>=1.4.1]@bincrafters/stable`
|
||||
|
||||
|
||||
## Features
|
||||
* Very fast (see [benchmarks](#benchmarks) below).
|
||||
|
32
third_party/spdlog/appveyor.yml
vendored
32
third_party/spdlog/appveyor.yml
vendored
@ -1,36 +1,32 @@
|
||||
version: 1.0.{build}
|
||||
image: Visual Studio 2017
|
||||
image: Visual Studio 2015
|
||||
environment:
|
||||
matrix:
|
||||
- GENERATOR: '"MinGW Makefiles"'
|
||||
BUILD_TYPE: Debug
|
||||
- GENERATOR: '"MinGW Makefiles"'
|
||||
BUILD_TYPE: Release
|
||||
- GENERATOR: '"Visual Studio 14 2015"'
|
||||
BUILD_TYPE: Debug
|
||||
WCHAR: 'OFF'
|
||||
- GENERATOR: '"Visual Studio 14 2015"'
|
||||
BUILD_TYPE: Release
|
||||
WCHAR: 'ON'
|
||||
- GENERATOR: '"Visual Studio 14 2015 Win64"'
|
||||
BUILD_TYPE: Debug
|
||||
WCHAR: 'ON'
|
||||
- GENERATOR: '"Visual Studio 14 2015 Win64"'
|
||||
BUILD_TYPE: Release
|
||||
WCHAR: 'ON'
|
||||
- GENERATOR: '"Visual Studio 15 2017 Win64"'
|
||||
BUILD_TYPE: Debug
|
||||
WCHAR: 'ON'
|
||||
- GENERATOR: '"Visual Studio 15 2017 Win64"'
|
||||
BUILD_TYPE: Release
|
||||
WCHAR: 'OFf'
|
||||
build_script:
|
||||
- cmd: >-
|
||||
set
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
set PATH=%PATH%:C:\Program Files\Git\usr\bin
|
||||
|
||||
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=%WCHAR% -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
||||
|
||||
set PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
|
||||
|
||||
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=ON -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF
|
||||
|
||||
cmake --build . --config %BUILD_TYPE%
|
||||
|
||||
|
2
third_party/spdlog/bench/CMakeLists.txt
vendored
2
third_party/spdlog/bench/CMakeLists.txt
vendored
@ -24,3 +24,5 @@ target_link_libraries(latency PRIVATE benchmark::benchmark spdlog::spdlog)
|
||||
|
||||
add_executable(formatter-bench formatter-bench.cpp)
|
||||
target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog)
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
22
third_party/spdlog/bench/latency.cpp
vendored
22
third_party/spdlog/bench/latency.cpp
vendored
@ -16,6 +16,26 @@
|
||||
#include "spdlog/sinks/null_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
void prepare_logdir()
|
||||
{
|
||||
spdlog::info("Preparing latency_logs directory..");
|
||||
#ifdef _WIN32
|
||||
system("if not exist logs mkdir latency_logs");
|
||||
system("del /F /Q logs\\*");
|
||||
#else
|
||||
auto rv = system("mkdir -p latency_logs");
|
||||
if (rv != 0)
|
||||
{
|
||||
throw std::runtime_error("Failed to mkdir -p latency_logs");
|
||||
}
|
||||
rv = system("rm -f latency_logs/*");
|
||||
if (rv != 0)
|
||||
{
|
||||
throw std::runtime_error("Failed to rm -f latency_logs/*");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void bench_c_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger)
|
||||
{
|
||||
const char *msg = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum pharetra metus cursus "
|
||||
@ -63,6 +83,8 @@ int main(int argc, char *argv[])
|
||||
size_t rotating_files = 5;
|
||||
int n_threads = benchmark::CPUInfo::Get().num_cpus;
|
||||
|
||||
prepare_logdir();
|
||||
|
||||
// disabled loggers
|
||||
auto disabled_logger = std::make_shared<spdlog::logger>("bench", std::make_shared<null_sink_mt>());
|
||||
disabled_logger->set_level(spdlog::level::off);
|
||||
|
1
third_party/spdlog/bench/meson.build
vendored
1
third_party/spdlog/bench/meson.build
vendored
@ -12,3 +12,4 @@ foreach i : bench_matrix
|
||||
benchmark('bench_' + i[0], bench_exe, args: i[2])
|
||||
endforeach
|
||||
|
||||
run_command(find_program('mkdir'), meson.current_build_dir() + '/logs')
|
||||
|
6
third_party/spdlog/cmake/spdlog.pc.in
vendored
6
third_party/spdlog/cmake/spdlog.pc.in
vendored
@ -7,7 +7,5 @@ Name: lib@PROJECT_NAME@
|
||||
Description: Fast C++ logging library.
|
||||
URL: https://github.com/gabime/@PROJECT_NAME@
|
||||
Version: @SPDLOG_VERSION@
|
||||
CFlags: -I${includedir} @PKG_CONFIG_DEFINES@
|
||||
Libs: -L${libdir} -lspdlog -pthread
|
||||
Requires: @PKG_CONFIG_REQUIRES@
|
||||
|
||||
CFlags: -I${includedir}/@SPDLOG_CFLAGS@
|
||||
Libs: -L${libdir}/@PROJECT_NAME@ -l@PROJECT_NAME@
|
||||
|
5
third_party/spdlog/cmake/utils.cmake
vendored
5
third_party/spdlog/cmake/utils.cmake
vendored
@ -29,10 +29,7 @@ function(spdlog_enable_warnings target_name)
|
||||
target_compile_options(${target_name} PRIVATE
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
|
||||
-Wall -Wextra -Wconversion -pedantic -Wfatal-errors>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/W4>)
|
||||
if(MSVC_VERSION GREATER_EQUAL 1910) #Allow non fatal security wanrnings for msvc 2015
|
||||
target_compile_options(${target_name} PRIVATE /WX)
|
||||
endif()
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>)
|
||||
endfunction()
|
||||
|
||||
|
||||
|
2
third_party/spdlog/example/CMakeLists.txt
vendored
2
third_party/spdlog/example/CMakeLists.txt
vendored
@ -25,3 +25,5 @@ if(SPDLOG_BUILD_EXAMPLE_HO)
|
||||
target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only)
|
||||
endif()
|
||||
|
||||
# Create logs directory
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
2
third_party/spdlog/example/example.cpp
vendored
2
third_party/spdlog/example/example.cpp
vendored
@ -143,7 +143,7 @@ void async_example()
|
||||
#include "spdlog/fmt/bin_to_hex.h"
|
||||
void binary_example()
|
||||
{
|
||||
std::vector<char> buf(80);
|
||||
std::vector<char> buf;
|
||||
for (int i = 0; i < 80; i++)
|
||||
{
|
||||
buf.push_back(static_cast<char>(i & 0xff));
|
||||
|
1
third_party/spdlog/example/meson.build
vendored
1
third_party/spdlog/example/meson.build
vendored
@ -1,4 +1,5 @@
|
||||
executable('example', 'example.cpp', dependencies: spdlog_dep)
|
||||
executable('example_header_only', 'example.cpp', dependencies: spdlog_headeronly_dep)
|
||||
run_command(find_program('mkdir'), meson.current_build_dir() + '/logs')
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user