Azamat H. Hackimov
9157873f5b
Fix compilation on GCC-13 ( #443 )
...
* Fix compilation on GCC-13
GCC-13 changes internal cstdint includes, and now files that uses
standart integer types should directly include cstdint header.
See: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Bug: https://bugs.gentoo.org/865117
Bug: https://bugs.gentoo.org/895440
* Convert line endings to Unix format
2023-02-25 13:50:35 -08:00
YuHuanTin
aa2ca19895
Added support for setting custom ping messages with support for any 'ping' message type (binary ping message, text ping message) ( #438 )
...
* Added support for setting custom ping messages with support for any 'ping' message type (binary ping message, text ping message)
* Add default value
---------
Co-authored-by: YuHuanTin <2@>
2023-02-23 08:29:07 -08:00
TheArtfulBodger
b0fd119d14
Host HTTP and WS on the same port ( #414 )
...
* Quick hack to host HTTP and WS on the same port #373
* Quick hack to host HTTP and WS on the same port #373 - simplify code
* ran clang-format
Co-authored-by: En Shih <seanstone5923@gmail.com>
Co-authored-by: The Artful Bodger <TheArtfulBodger@users.noreply.github.com>
2022-11-05 18:53:11 -07:00
Andreas Hausladen
b5cf33a582
Introduction of IXWebSocketSendData ( #347 )
...
* Introduction of IXWebSocketSendData that makes it possible to not only send std::string but also std::vector<char/uint8_t> and char* without copying them to a std::string first.
Add a sendUtf8Text() method that doesn't check for invalid UTF-8 characters. The caller must guarantee that the string only contains valid UTF-8 characters.
* Updated usage.md: sendUtf8Text() and IXWebSocketSendData
2022-01-10 10:34:24 -08:00
Benjamin Sergeant
0813eb1788
mention disablePerMessageDeflate in the doc
2021-03-16 09:56:08 -07:00
Benjamin Sergeant
75e9c84388
fix buggy message and remove un-needed include
2020-11-19 14:27:10 -08:00
Benjamin Sergeant
22dffd5b7e
WebSocket::close is re-entrant
2020-07-27 17:38:33 -07:00
Benjamin Sergeant
3a673575dd
clang format
2020-07-08 10:39:46 -07:00
Benjamin Sergeant
543c2086b2
more templates in WebSocketTransport
2020-07-07 21:26:42 -07:00
Benjamin Sergeant
9b8cfa0a37
(websocket) add a positive number to the heartbeat message sent, incremented each time the heartbeat is sent
2020-04-15 18:33:36 -07:00
Benjamin Sergeant
37a054723a
(websocket) use persistent member variable as temp variables to encode/decode zlib messages in order to reduce transient allocations
2020-04-13 21:38:15 -07:00
Benjamin Sergeant
0fffb1e894
(websocket) fix data race accessing _socket object without mutex protection when calling wakeUpFromPoll in WebSocketTransport.cpp
2020-03-26 19:31:59 -07:00
Benjamin Sergeant
179e17895d
unique_ptr for sockets
2020-03-24 12:48:55 -07:00
Benjamin Sergeant
9dcc2538ae
(websocket) reset per-message deflate codec everytime we connect to a server/client
2020-03-23 18:46:30 -07:00
Benjamin Sergeant
6085839ef7
minor refactoring
2020-03-18 11:45:28 -07:00
Benjamin Sergeant
b287730c19
Simplify ping/pong based heartbeat implementation
2020-03-18 01:14:08 -07:00
Benjamin Sergeant
fe29579755
refactor receiving socket code in its own method
2020-01-09 12:00:42 -08:00
Benjamin Sergeant
a5bc39be55
(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 (troubleshooting #140 )
2020-01-06 14:34:43 -08:00
Benjamin Sergeant
cae016564e
(server) attempt at fixing #131 by using blocking writes in server mode
2019-12-12 12:17:29 -08:00
Benjamin Sergeant
afed387bcf
Socket Factory has only one function which works for server and client code, and can do tls for both
2019-09-30 22:06:46 -07:00
Benjamin Sergeant
313949f087
SocketServer::handleConnection takes an std::shared_ptr<Socket> instead of a file descriptor
2019-09-30 21:48:55 -07:00
Benjamin Sergeant
cd3c9d879c
reformat everything with clang-format
2019-09-23 10:25:23 -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
0bf185e143
Per message deflate/compression: handle fragmented messages (fix autobahn test: 12.1.X and probably others)
2019-09-03 17:42:48 -07:00
Benjamin Sergeant
b4c4746d43
IXWebSocketTransport message processing refactoring
2019-09-03 15:48:55 -07:00
Benjamin Sergeant
ab93e4f168
Message type (TEXT or BINARY) is invalid for received fragmented messages (fix autobahn test: 5.3 through 5.8 Fragmentation)
2019-09-03 09:13:38 -07:00
Benjamin Sergeant
94c8966e86
Close connections when reserved bits are used (autobahn test: 3 Reserved Bits)
2019-09-01 16:23:00 -07:00
Benjamin Sergeant
d3e5a63fa2
ws connect has a new option to send HTTP headers + use WebSocketHttpHeaders instead of unordered_map<string, string>
2019-08-26 10:19:09 -07:00
ozychhi
93debc00dc
Add client handshake extra headers ( #105 )
...
Even though 6455 defines all the necessary headers needed for
client/server handshake, in practice most of the cases websocket servers
expect few more headers. Therefore adding this functionality.
2019-08-26 09:37:40 -07:00
Benjamin Sergeant
3e15840b14
- WebSocket::send() sends message in TEXT mode by default
...
- WebSocketMessage sets a new binary field, which tells whether the received incoming message is binary or text
2019-06-09 11:56:47 -07:00
Benjamin Sergeant
c65fec7271
clang format, based on cpprest
2019-05-30 08:46:50 -07:00
Benjamin Sergeant
58f17ddb09
remove dead code
2019-05-16 15:05:20 -07:00
Benjamin Sergeant
309ed80446
Add constants for closing code and messages
2019-05-16 12:46:53 -07:00
Benjamin Sergeant
243f41bf28
use a regular mutex instead of a recursive one + stop properly
2019-05-15 19:26:02 -07:00
Benjamin Sergeant
12fe55905c
enum class HttpErrorCode derives from int
2019-05-15 16:50:00 -07:00
Benjamin Sergeant
5ad15fad8b
recursive mutex + enable test that was breaking on Ubuntu Xenial + gcc + tsan
2019-05-15 16:01:05 -07:00
Benjamin Sergeant
e0d9a16985
more protection against socket when closing
2019-05-15 15:18:46 -07:00
Kumamon38
27bf1684cb
save timepoints after connect and not in contructor, adjusted tests ( #72 )
...
* save timepoints after connect and not in contructor, adjusted tests
* move call into setReadyState
* more time to detect client close in test
2019-05-13 09:08:46 -07:00
Dimon4eg
99a3bbc4f9
use C++11 enums ( #67 )
...
* use C++11 enums
* small rename
* update tests
* update tests
* update ws
* update ws
* update README.md
2019-05-11 14:22:06 -07:00
tiwariashish86
b1d13105e7
Fixed pong synchronization issue ( #62 )
...
* Fixed pong synchronization issue
* Minor optimization in lock by scoping it to necessary changes.
* Fixing compilation issues
2019-05-09 15:06:05 -07:00
Kumamon38
1eb98cc74f
fix ping, fix send frame close ( #49 )
...
* fix ping, fix send frame close
* fixes for data race on _closeCode etc. and fix test
* fixing one TC
* fix waiting forever if no time to change of readyState, and poll never end
* add 1005 code if no status code received
* fixes for 1005 code
* fix test issue
* fix macOS issue
* revert to master tests and renaming
2019-05-09 09:21:05 -07:00
Alexandre Konieczny
6918f863b1
fix data race on _useMask
2019-04-29 16:41:34 -07:00
Kumamon38
28210ee31d
add boolean and add missing protocol error close constant ( #41 )
2019-04-23 04:31:55 -07:00
Benjamin Sergeant
7df7453365
indentation / comestic changes
2019-04-19 16:57:38 -07:00
Kumamon38
aea859af52
Ping timeout use constant ( #36 )
...
* use constant for ping timeout
* change close code types
2019-04-19 09:16:25 -07:00
Kumamon38
5682129b1d
fix close code/reason issue ( #34 )
...
* fix close code/reason issue
* added code 1006 for abnormal closure
2019-04-18 10:02:31 -07:00
Kumamon38
c3431f19bf
Real ping ( #32 )
...
* close method change and fix code
* missing mutex
* wip
* renaming and fixes
* renaming, fixes
* added enablePong/disablePong, add tests
* added new test cases
* add 1 test case
* fix gcd name to greatestCommonDivisor
* move ping and ping timeout checks into socket poll, local var in test cases and indent fixes
* indent issue
2019-04-18 09:24:16 -07:00
Benjamin Sergeant
b0f6026c23
make closeWireSize a default parameter of WebSocketTransport::close
2019-04-16 09:55:12 -07:00
Kumamon38
b2aca491b6
close method change and fix code ( #28 )
...
* close method change and fix code
* missing mutex
2019-04-16 08:58:34 -07:00
Benjamin Sergeant
f029321664
can send TEXT message (we only support BINARY messages now)
2019-03-22 14:24:22 -07:00