Commit Graph

147 Commits

Author SHA1 Message Date
Benjamin Sergeant
c5aadffa08 (redis cobra bots) update the cobra to redis bot to use the bot framework, and change it to report fps metrics into redis streams. 2020-06-10 22:30:55 -07:00
flagarde
e0aace33ea
Update CMakeLists.txt (#207) 2020-05-21 08:46:06 -07:00
Benjamin Sergeant
2319dec278 (cmake) revert CMake changes to fix #203 and be able to use an external OpenSSL 2020-05-20 10:56:58 -07:00
Benjamin Sergeant
54d4d81bf4 (cmake) make install cmake files optional to not conflict with vcpkg
See https://github.com/microsoft/vcpkg/pull/11030
2020-05-17 20:36:46 -07:00
Benjamin Sergeant
ea207d8199 (windows + tls) mbedtls is the default windows tls backend + add ability to load system certificates with mbdetls on windows 2020-05-17 20:36:46 -07:00
Benjamin Sergeant
c1403df74a (cmake) default TLS back to mbedtls on Windows Universal Platform 2020-05-08 09:31:53 -07:00
Benjamin Sergeant
3912e22b28 give websocket_subprotocol test more time to establish a connection 2020-05-08 09:26:05 -07:00
XLPhere
c9d5b4a581
Moved fPIC option to the top of the CMakeLists (#197)
The fPIC option was not properly registered before
2020-05-08 08:00:51 -07:00
Benjamin Sergeant
fc4a4bfb7c
fix #194 / linux needs to built with position independant code 2020-05-03 12:19:58 -07:00
ebenali
9e54fd5f1a
Fix CMake/zlibstatic-related regression (#192)
* cmake: add export() and install(EXPORT) for easier packageability

Enable the package to be more readily packageable as a system-wide
install or as a third-party dependency to another CMake-base project

This does not change CMake version requirements AFAICT

* CMake: link-in OpenSSL::Crypto

* CMake: explicitly manage dependencies. Fixes building with zlibstatic
2020-05-02 22:08:58 -07:00
ebenali
1096f62196
cmake: add export() and install(EXPORT) for easier packageability (#190)
* cmake: add export() and install(EXPORT) for easier packageability

Enable the package to be more readily packageable as a system-wide
install or as a third-party dependency to another CMake-base project

This does not change CMake version requirements AFAICT

* CMake: link-in OpenSSL::Crypto
2020-05-02 20:20:59 -07:00
Benjamin Sergeant
33ebd00932 fix cmake tls backend option parsing 2020-04-27 11:29:50 -07:00
Benjamin Sergeant
fbe5e74109 fix openssl cmake errors 2020-04-27 10:59:47 -07:00
Benjamin Sergeant
a9f5d5353f fix cmake syntax error and convert some errors to fatal errors 2020-04-27 10:29:27 -07:00
Benjamin Sergeant
22e0083832 CMake TLS cleanup 2020-04-27 10:09:51 -07:00
Benjamin Sergeant
74efdfebba remove bundled mbedtls 2020-04-25 15:41:39 -07:00
Benjamin Sergeant
0ab04f51fe (ssl) Default to OpenSSL on Windows, since it can load the system certificates by default 2020-04-25 15:36:31 -07:00
Benjamin Sergeant
79acb915ce merge the 2 url parsing file into one, fix a silly build error 2020-04-24 14:08:59 -07:00
Benjamin Sergeant
bad3adb6b4 cmake pb with renamed file 2020-04-24 12:55:00 -07:00
Benjamin Sergeant
e3dd4e60c0 remove deleted IXSelectInterruptEventFd file reference in cmake 2020-04-24 12:52:13 -07:00
Benjamin Sergeant
c70f1d09a8 include all ssl backends inside special per backend macro 2020-04-24 12:47:47 -07:00
Benjamin Sergeant
432f0570f4 (websocket) WebSocketMessagePtr is a unique_ptr instead of a shared_ptr 2020-04-13 21:56:01 -07:00
Benjamin Sergeant
f3b97097cd (windows) ci: windows build with TLS (mbedtls) + verify that we can be build with OpenSSL 2020-04-04 17:49:52 -07:00
Matthew Albrecht
da36856d85
Only find zlib if it has not already been found. (#169) 2020-03-26 09:39:51 -07:00
Benjamin Sergeant
dffa759f71 move IXBench code under ixwebsocker folder 2020-03-24 20:53:25 -07:00
Benjamin Sergeant
a0ffb2ba53 cobra to statsd bot ported to windows + add unittest 2020-03-22 19:37:04 -07:00
Benjamin Sergeant
5ad54a8904 pre-commit / fix simple file trailing things 2020-03-21 19:31:38 -07:00
Benjamin Sergeant
3df7c942d7 move sentry and statsd cobra ws commands into a new ixbots folder 2020-03-11 15:55:56 -07:00
Rok Krhlikar
e581f29b42
Move zlib include_directories before add_subdirectory (#159) 2020-02-28 09:30:37 -08:00
Benjamin Sergeant
65bae2736d fix #144 - get rid of stubbed windows ssl schannel backend 2020-01-14 13:39:48 -08:00
Matthew Albrecht
b816f1fbda Allow custom OpenSSL lib, only include openssl/x509v3.h when used. (#143)
* Allow custom OpenSSL lib, only include openssl/x509v3.h when used.

Using fnmatch on Unix systems, PathMatchSpecA is the best WINAPI equivalent.

* Moved shlwapi into WIN32 block.
2020-01-08 13:57:57 -08:00
Matthew Albrecht
34d7b18c85 Allow configuration of Mbed TLS use. (#142)
* Allow configuration of Mbed TLS use.

* Added option for OpenSSL support.

* Fixed elseif/else mixup from 5ebad24040
2020-01-07 14:57:47 -08:00
Benjamin Sergeant
5c5ea6dec1 (ws) #125 / cmake detects an already installed jsoncpp and will try to use this one if present 2019-12-03 16:01:46 -08:00
Benjamin Sergeant
16c6f08e2d fix android build + proxy work 2019-11-16 06:51:53 -08:00
Benjamin Sergeant
bbfa76a2c9 move sentry code around and add a stub unittest for it 2019-10-25 14:54:31 -07:00
Benjamin Sergeant
c3a619f114 Add client support for websocket subprotocol. Look for the new addSubProtocol method for details 2019-10-13 13:37:34 -07:00
Benjamin Sergeant
852bf452b6 Freebsd (#117)
* add file

* CMake freebsd fix
2019-10-09 17:00:32 -07:00
Benjamin Sergeant
f6bf2531bb Add ability to use OpenSSL on apple platforms. 2019-09-29 15:34:58 -07:00
Benjamin Sergeant
681390f22f update and change how we build with spdlog 2019-09-29 11:13:24 -07:00
Benjamin Sergeant
1cde26771a move snake code to its own subfolder like ixcobra, ixcrypto, etc... 2019-09-23 11:46:16 -07:00
Matt DeBoer
408ee41990 WIP: support configurable certificates/keys, and root trust CAs (#114)
* wip: tls options implemented in openssl

* update naming, remove #define guard

* assert compiled with USE_TLS for tls options

* apply autoformatter

* include tls options impl

* style cleanup; auto ssl_err

* ssl_err -> sslErr

* be explicit about SSL_VERIFY_NONE
2019-09-22 18:06:15 -07:00
Benjamin Sergeant
2453f5b717 restructure project 2019-09-10 12:19:22 -07:00
Benjamin Sergeant
427db5bd59 Fix Windows CI with appveyor (#110)
Fix windows CI with appveyor + minor tweaks.
2019-09-07 14:07:00 -07:00
Benjamin Sergeant
51799353a6 Sending invalid UTF-8 TEXT message should fail and close the connection (fix remaining autobahn test: 6.X UTF-8 Handling) 2019-09-03 14:12:40 -07:00
Benjamin Sergeant
a95fcbbdbf user agent 2019-08-30 12:50:56 -07:00
Benjamin Sergeant
7a73ec7c06 New option to cap the max wait between reconnection attempts. Still default to 10s. (setMaxWaitBetweenReconnectionRetries) (#108) 2019-08-30 12:46:35 -07:00
Benjamin Sergeant
3b1a1efed2 fix #104 - change ZLIB find_package to be optional 2019-08-26 14:51:33 -07:00
Benjamin Sergeant
b2f9c219b1 cmake use_tls fix 2019-06-24 23:34:31 -07:00
Benjamin Sergeant
f84bc53c8d Feature/httpd (#94)
* Stub code for http server

* can send a response, cannot process body yet

* write headers to the response

* remove commented code

* add simple test + set default http handler

* tweak CI + unittest

* add missing file

* rewrite http::trim in a simple way

* doc
2019-06-23 14:54:21 -07:00
Benjamin Sergeant
71aad26d44 (cmake) missing find_package(Threads) on UNIX 2019-06-10 13:39:22 -07:00
Benjamin Sergeant
a1709c07d9 - mbedtls and zlib are searched with find_package, and we use the vendored version if nothing is found 2019-06-10 11:18:27 -07:00
Benjamin Sergeant
2e5f24f1f8 ... 2019-06-09 10:22:27 -07:00
Benjamin Sergeant
396d0d9bdc Feature/ws windows (#86)
* try to build ws on window on travis 📮

* cmake invocation fixed on windows 🐝

* Can use mbedtls to calculate hmac + no openssl config option

* build only windows on travis 🕢

* run msbuild 💷

* proper command to build 🕛

* some build fixes

* change weird sizeof call 🐙

* warning and missing includes fixes 💮

* ifdef out statsd code on windows 🐍

* logic invertion in ifdef 👄

* bring back makefile 📜

* command line tool is built with mbedtls 🏥
2019-06-02 20:46:20 -07:00
Benjamin Sergeant
06cbebe22e Feature/mbedtls (#84)
* try to import mbedtls and build it

* add stubs socket class

* some boilterplate, read and write function implemented

* more boilterplate / current error in handshake because no CA cert is setup

* add something so skip ca verification, can ws curl https://google.com !

* cleanup / close implemented

* tweak CMakefiles

* typo in include

* update readme

* disable unittests
2019-06-01 17:41:48 -07:00
Benjamin Sergeant
6bd81bb92e add back IXWebSocketMessageQueue, with its unittest disabled 2019-05-16 22:41:39 -07:00
Benjamin Sergeant
51fa147b99 Revert "Merge branch 'Dimon4eg-message-queue'"
This reverts commit 13fa325134, reversing
changes made to aecd5e9c94.
2019-05-16 22:15:17 -07:00
Benjamin Sergeant
90d71deb0f Add constants for closing code and messages 2019-05-16 19:23:32 -07:00
Benjamin Sergeant
0c9bcfb8ac more protection against socket when closing 2019-05-16 19:23:32 -07:00
dimon4eg
467f99b3bb Rename to WebSocketMessageQueue 2019-05-09 00:09:51 +03:00
Dimon4eg
45d40dc159 Added IXWebSocketPoll class 2019-05-08 22:02:56 +03:00
Dimon4eg
979ff60a6b Use LUrlParser to fix issue of Windows (#53)
LGTM
2019-05-06 14:45:02 -07:00
Dimon4eg
4fbc4e3be9 Fixes for windows (#45)
* init Net system on Windows

* propagate DNS error

* Add zlib 1.2.11 sources

* link zlib statically for windows

* remove not implemented function declaration

* fix connect on Windows
2019-04-25 16:26:53 -07:00
Dimon4eg
52260a63fb Speedup build for Windows (#43)
* Speedup build for Windows

* add space :)
2019-04-25 07:41:01 -07:00
Benjamin Sergeant
1c2b6d59da Fix #37 / add directives to install headers and library 2019-04-21 11:42:37 -07:00
Dimon4eg
f61fd7b7f1 Link zlib statically for windows (#35)
* Add zlib 1.2.11 sources

* link zlib statically for windows
2019-04-19 09:14:03 -07:00
Dimon4eg
401fc39879 fix windows build (#29)
* fix windows build

* fix for Unix

* Fix build if TLS is OFF

* add OpenSSL req to ws

* Fix build on Mac

* fix tests for windows
2019-04-16 08:51:57 -07:00
Dimon4eg
d4b0839328 move security framework linking to ixwebsocket (#26) 2019-04-14 17:13:24 -07:00
Benjamin Sergeant
5b6fdb6526 cleanup, remove dead method 2019-03-21 10:06:59 -07:00
Benjamin Sergeant
fe700d1e7b (cmake) add a warning about 32/64 conversion problems. 2019-03-20 21:51:38 -07:00
Benjamin Sergeant
eac611ab1e Feature/connection state (#25)
* (cmake) add a warning about 32/64 conversion problems.

* fix typo

* New connection state for server code + fix OpenSSL double init bug

* update README
2019-03-20 18:34:24 -07:00
Benjamin Sergeant
0635313566 Feature/redis (#23)
* Fix warning

* (cmake) add a warning about 32/64 conversion problems.

* simple redis clients

* can publish to redis

* redis subscribe

* display messages received per second

* verbose flag

* (cmake) use clang only compile option -Wshorten-64-to-32 when compiling with clang
2019-03-20 14:29:02 -07:00
Benjamin Sergeant
68e397ab34 use pipe to abort select on Linux as well as macOS 2019-03-15 17:46:40 -07:00
Benjamin Sergeant
b91dc77d6f select interrupt cleanup 2019-03-14 18:37:38 -07:00
Benjamin Sergeant
2c86fd947f Feature/http (#16)
* add skeleton and broken http client code.

GET returns "Resource temporarily unavailable" errors...

* linux compile fix

* can GET some pages

* Update formatting in README.md

* unittest for sending large messages

* document bug

* Feature/send large message (#14)

* introduce send fragment

* can pass a fin frame

* can send messages which are a perfect multiple of the chunk size

* set fin only for last fragment

* cleanup

* last fragment should be of type CONTINUATION

* Add simple send and receive programs

* speedups receiving + better way to wait for thing

* receive speedup by using linked list of chunks instead of large array

* document bug

* use chunks to receive data

* trailing spaces

* Update README.md

Add note about message fragmentation.

* Feature/ws cli (#15)

* New command line tool for transfering files / still very beta.

* add readme

* use cli11 for argument parsing

* json -> msgpack

* stop using base64 and use binary which can be stored in message pack

* add target for building with homebrew

* all CMakeLists are referenced by the top level one

* add ws_chat and ws_connect sub commands to ws

* cleanup

* add echo and broadcast server as ws sub-commands

* add gitignore

* comments

* ping pong added to ws

* mv cobra_publisher under ws folder

* Update README.md

* linux build fix

* linux build fix

* move http_client to a ws sub-command

* simple HTTP post support (urlencode parameters)

* can specify extra headers

* chunk encoding / simple redirect support / -I option

* follow redirects is optional

* make README vim markdown plugin friendly

* cleanup argument parsing + add socket creation factory

* add missing file

* http gzip compression

* cleanup

* doc

* Feature/send large message (#14)

* introduce send fragment

* can pass a fin frame

* can send messages which are a perfect multiple of the chunk size

* set fin only for last fragment

* cleanup

* last fragment should be of type CONTINUATION

* Add simple send and receive programs

* speedups receiving + better way to wait for thing

* receive speedup by using linked list of chunks instead of large array

* document bug

* use chunks to receive data

* trailing spaces
2019-02-28 21:54:03 -08:00
Benjamin Sergeant
67e5957064 comments 2019-02-22 21:27:49 -08:00
Benjamin Sergeant
76e2f9f3ac add ws_chat and ws_connect sub commands to ws 2019-02-22 20:49:26 -08:00
Benjamin Sergeant
41a40b8b9f all CMakeLists are referenced by the top level one 2019-02-21 22:21:29 -08:00
Benjamin Sergeant
932bb732e0 Feature/send large message (#14)
* introduce send fragment

* can pass a fin frame

* can send messages which are a perfect multiple of the chunk size

* set fin only for last fragment

* cleanup

* last fragment should be of type CONTINUATION

* Add simple send and receive programs

* speedups receiving + better way to wait for thing

* receive speedup by using linked list of chunks instead of large array

* document bug

* use chunks to receive data

* trailing spaces
2019-02-20 18:59:07 -08:00
Benjamin Sergeant
a0f15bfb56 C++14 + use make_unique and make_shared to make shared pointers 2019-01-11 21:25:06 -08:00
Benjamin Sergeant
20c8953e5b remove openssl testing bits for apple build 2019-01-06 14:21:49 -08:00
Benjamin Sergeant
57c22cddb8 make a class hierarchy for server code (IXWebSocketServer <- IXSocketServer) 2019-01-06 12:09:31 -08:00
Benjamin Sergeant
0fd06bb592 int -> ssize_t for socker recv and send 2019-01-05 20:53:50 -08:00
Benjamin Sergeant
9641c8cf49 header refactoring 2019-01-05 20:38:43 -08:00
Benjamin Sergeant
3eef8fba27 unittest on appveyor 2019-01-04 17:28:13 -08:00
Benjamin Sergeant
97255fbd62 cancellation refactoring 2019-01-03 12:53:44 -08:00
Benjamin Sergeant
64f649d1f9 split handshake code into its own files, so that Transport file is less massive 2019-01-02 20:07:54 -08:00
Benjamin Sergeant
0ee71e9a09 proof of concept server implementation 2018-12-29 23:15:27 -08:00
Benjamin Sergeant
43cd6d34ca add simple unittest 2018-12-29 18:34:08 -08:00
Benjamin Sergeant
a79f4c10a1 set thread name / rename example 2018-12-23 14:14:38 -08:00
Benjamin Sergeant
cbadecab33 non blocking dns lookup 2018-12-14 16:28:17 -08:00
Benjamin Sergeant
62528e6a0b http upgrade and connections use non blocking sockets 2018-12-09 14:07:40 -08:00
Benjamin Sergeant
e847716076 move files around 2018-11-12 17:56:59 -08:00
Benjamin Sergeant
9cb1d03411 tweaks doc / license + send proper error code when closing the connecion 2018-11-12 09:00:55 -08:00
Benjamin Sergeant
4fed156b90 per message deflate support (with zlib) 2018-11-09 18:42:09 -08:00
Benjamin Sergeant
6dbfe28427 Add new example folder for publishing events to satori, with a minimal satori sdk 2018-11-07 12:26:32 -08:00
Benjamin Sergeant
cf0045a483 stopping connection on Linux does not close the socket, which can create problem when re-starting the connection 2018-11-01 17:02:49 -07:00
Benjamin Sergeant
af12089e7a make TLS support optional 2018-10-08 15:24:36 -07:00