Commit Graph

29 Commits

Author SHA1 Message Date
Glenn Engel
28832f8732
Fix #286 - http response headers overwritten with request headers (#483) 2023-09-01 08:11:07 -07:00
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
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
李浩能
472cf68c31
add Content-Type support (#405) 2022-10-12 06:43:05 -07:00
flagarde
74bb85efe9
Add getters (#327)
* Add getters for IXSocketServer class

* Add getters for IXHttpServer class

* Add getters for IXWebSocketServer class
2021-11-24 08:28:25 -08:00
Benjamin Sergeant
fa0408e70b (http client + server + ws) Add support for uploading files with ws -F foo=@filename, new -D http server option to debug incoming client requests, internal api changed for http POST, PUT and PATCH to supply an HttpFormDataParameters 2020-10-08 12:43:18 -07:00
Benjamin Sergeant
6f188a5131 (ws) add gzip and gunzip ws sub commands 2020-09-28 10:19:27 -07:00
Benjamin Sergeant
128bc0afa9 (http server) read body request when the Content-Length is specified + set timeout to read the request to 30 seconds max by default, and make it configurable as a constructor parameter 2020-09-12 14:17:06 -07:00
Benjamin Sergeant
73b9c0b89b (socket servers) merge the ConnectionInfo class with the ConnectionState one, which simplify all the server apis 2020-08-28 14:55:40 -07:00
Benjamin Sergeant
6f0307fb35 (build) make using zlib optional, with the caveat that some http and websocket features are not available when zlib is absent 2020-07-31 22:54:57 -07:00
Benjamin Sergeant
2798886c0b (websocket server) add a new simpler API to handle client connections / that API does not trigger a memory leak while the previous one did 2020-07-23 19:29:41 -07:00
Benjamin Sergeant
fbd17685a1 (socket+websocket+http+redis+snake servers) expose the remote ip and remote port when a new connection is made (see #222) / only ipv4 is handled 2020-07-08 12:10:35 -07:00
Benjamin Sergeant
3a673575dd clang format 2020-07-08 10:39:46 -07:00
Benjamin Sergeant
268f528423 httpd gzip compression / set a response header and search for gzip in the request header in case deflate is added to gzip in there 2020-06-01 17:11:42 -07:00
Benjamin Sergeant
4872b59fac fix windows build (or operator is not supported || is required 2020-05-29 17:18:09 -07:00
Benjamin Sergeant
bb1be240ec fix linux compile failure 2020-05-29 16:53:57 -07:00
Benjamin Sergeant
b008c97c83 (http server) support gzip compression 2020-05-29 16:49:29 -07:00
Benjamin Sergeant
179e17895d unique_ptr for sockets 2020-03-24 12:48:55 -07:00
Benjamin Sergeant
4c66a7561e (WebSocketServer) add option to disable deflate compression, exposed with the -x option to ws echo_server 2020-02-18 21:38:28 -08:00
Benjamin Sergeant
5d4bb90703 (SocketServer) add ability to bind on an ipv6 address 2020-01-26 16:21:56 -08:00
Benjamin Sergeant
9dfcd8ea69 (ws client) all commands use spdlog instead of std::cerr or std::cout for logging 2019-12-24 21:55:34 -08: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
4cd11fdbc7 mbedtls fixes / the unittest now pass on macOS, and hopefully will on Windows/AppVeyor as well. 2019-09-27 14:07:01 -07:00
Benjamin Sergeant
6762978ddf http server unittest + refactoring 2019-09-26 09:45:59 -07:00
Benjamin Sergeant
cd3c9d879c reformat everything with clang-format 2019-09-23 10:25:23 -07:00
Benjamin Sergeant
fb271953f7 websocket and http server: server does not close the bound client socket in many cases 2019-09-09 16:48:26 -07:00
Benjamin Sergeant
a95fcbbdbf user agent 2019-08-30 12:50:56 -07:00
Benjamin Sergeant
e8a20c7e8a refactor select code + add protection against large fds (cf Android 9) 2019-06-25 15:41:39 -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