Juan M Gómez
e27c10ad41
Some minimal changes to be able to base the nimlangserver in json_rpc ( #222 )
...
* adds processClientHook
This is useful to shape the request and response to defined protocols (i.e. lsp)
* overloads tryRoute
* apply suggestions
* update test
2024-07-23 17:05:54 +07:00
jangko
85d6a67fbc
Move CancelledError handling to outer try/except of RpcWebsocketServer
2024-01-29 10:40:40 +07:00
jangko
c5c40af304
HttpAuthHook use async raises
2024-01-27 18:00:02 +07:00
jangko
110c45a333
http server better exception handling
2024-01-27 14:47:24 +07:00
jangko
9a34452e23
Refactoring: extract rpc handler from HTTP and WebSocket server
2024-01-25 19:43:00 +07:00
jangko
dad0255c71
Client pass meaningful error to newFut when processMessage failed
2024-01-23 12:10:33 +07:00
jangko
b6d068f489
Fix improper yield usage in json-rpc-websocketserver
2024-01-15 10:59:16 +07:00
jangko
66208055bc
Both http server and client now can handle chunked transfer
2024-01-12 17:05:55 +07:00
jangko
08ceae27e0
Move errors module back to json_rpc folder
2024-01-08 10:37:29 +07:00
jangko
20b4c9a0fb
Let the OS choose the port for tests
2024-01-07 15:33:43 +07:00
andri lim
e0b077fea4
Upgrade rpc router internals ( #178 )
...
* Upgrade rpc router internals
* use new chronos asyncraises
* Fix style mismatch
* Fix nim v2 compilation error
* Addresing review
* Remove unnecessary custom serializer and let the library do the work
* fix error message
* Update readme.md
2024-01-03 20:06:53 +07:00
jangko
c3769f9130
Add copyright to source file
2023-12-14 08:34:13 +07:00
Jacek Sieka
33360528d2
fix improper yield usage ( #175 )
...
`yield` does not work with chronos futures
2023-12-13 09:21:50 +07:00
jangko
b067143788
fix ws server param type
2023-08-15 13:49:31 +07:00
Ivan Folgueira Bande
0bf2bcbe74
httpserver.nim: adding 'Content-Type: application/json' header to the response ( #165 )
2023-06-15 11:11:26 +02:00
jangko
38950a786d
reduce compiler warnings
2023-02-22 12:00:35 +07:00
Jacek Sieka
c0ecb42613
normalise nimble, update ci, unittest2 ( #158 )
2022-12-02 13:17:27 +01:00
Tanguy
4e9cc184ca
Fix newRng usage ( #157 )
2022-11-24 12:10:08 +01:00
Jacek Sieka
e6810af618
expose http server options ( #154 )
...
* expose http server options
These are needed to create a server that can handle larger POST requests
* add socket flag options
2022-10-25 18:48:44 +02:00
jangko
5ccdaed0ad
add rng param to rpcWebsocketServer constructor
2022-07-27 09:46:36 +07:00
jangko
0fee4be2cc
implement hook to handle CORS and JWT auth
...
- fixes #138
- fixes #126
- fixes #38
2022-07-17 23:06:08 +07:00
Jordan Hrycaj
b80313bfed
Facilitate http code response on authentication failure ( #134 )
2022-04-07 08:34:10 +01:00
Jordan Hrycaj
d4ae2328d4
Add server Hook for authentication ( #133 )
...
why:
JWT authentication needs that
2022-04-05 16:19:52 +01:00
Jacek Sieka
77c85a8876
fix missing logging import
2021-12-17 11:36:49 +01:00
Zahary Karadjov
c455198d4f
Eliminate code duplication in the HTTP/S servers
2021-11-22 20:24:11 +02:00
Zahary Karadjov
7ab1b31614
Fix code breakage after the rebase
2021-11-22 17:05:26 +02:00
Bernardo A. Rodrigues
3599a73b58
Chronos HTTP(S) Server ( #111 )
2021-11-22 15:14:30 +02:00
jangko
b2417fc071
fix both ws rpc server and client due to websock breaking changes
...
- change recv() to recvMsg()
2021-08-05 14:54:36 +07:00
KonradStaniec
a138c410c5
[FEATURE] Add additional constructor to the proxy ( #108 )
2021-07-12 07:22:01 +02:00
KonradStaniec
147ef3f562
[FEATURE] Add http json rpc proxy ( #105 )
2021-06-29 18:13:31 +03:00
jangko
809172abe4
rename ws to websock
2021-06-29 11:51:05 +07:00
jangko
62becee070
rpcwsserver: allocate deflateFactory only if compression enabled
2021-06-25 16:41:58 +07:00
jangko
b9e9be8f19
use string.fromBytes to replace cast[string](bytes)
2021-06-24 06:52:32 +07:00
jangko
69e8be66fb
add compression support for websocket rpc server-client
...
fixes #62
2021-06-24 06:52:31 +07:00
jangko
c6be913c69
implement json rpc websocket server
...
- both ws and wss mode
fixes #76
2021-06-23 18:44:33 +07:00
Jacek Sieka
64d40d6c1a
simplify imports ( #98 )
...
remove broken uint64 converter - upstream std/json also includes a
broken uint64 converter
2021-03-26 13:17:00 +01:00
Jacek Sieka
4eb39203eb
fixes ( #95 )
...
* fixes
* fix https://github.com/status-im/nimbus-eth2/issues/1650
* only one of `result` and `error` allowed in response
* fix invalid `string` instances being created from byte sequences
* fix large int64 parsing on 32-bit
* fix exception inheritance
* fix some dangling results
* some cleanups
* annotate exception issues, fix cancellation
* more error handling cleanup
* add rudimentary error tests
* cleanups
* simplify init
* use nextId -> lastId to avoid =1 init
* remove obsolete tests
2021-02-15 13:45:51 +01:00
Jacek Sieka
ce51ffdf16
print url in log startup message ( #89 )
...
...and tone down connection logging
2021-01-07 10:42:26 +01:00
Giovanni Petrantoni
62349c39c6
avoid spamming logs when rpcs happen ( #83 )
2020-09-05 20:41:26 +02:00
Ștefan Talpalaru
d90bdb679b
can't use result when returning Future[void]
2020-08-07 17:24:15 +02:00
Viktor Kirilov
271512c161
proper name for topics so that we can filter dynamically using chronicles
2020-06-09 17:00:21 +03:00
Zahary Karadjov
d19de19128
Refactor the router to allow bypassing the use of std/json
...
The users will be now able to write RPC handlers returning the
distinct type `StringOfJson`. This will bypass any use of the
standard library's JsonNode type and its serialization routines.
The change was motivated by the integration of JSON-RPC in
status-im/nim-beacon-chain where most of the data types cannot
be handled by Nim's std lib or json-rpc's jsonmarshal module.
2020-03-17 20:38:52 +02:00
Zahary Karadjov
4d1d2577e9
Trivial changes required for the beacon node integration
2020-03-17 00:17:10 +02:00
Ștefan Talpalaru
09f6fd6355
fix logging in JSON format
2020-02-13 17:05:55 +01:00
Ștefan Talpalaru
72a99cc977
replace getCurrentExceptionMsg() and delete some unused imports
2019-12-02 12:26:09 +01:00
cheatfate
a56ad7dfcb
Fix freezes on *nix systems.
2019-05-14 18:42:51 +03:00
cheatfate
2d3db88137
Fix deprecated warnings.
2019-03-25 19:28:31 +02:00
Mamy Ratsimbazafy
53ed44dfa5
Rebrand asyncdispatch2 to chronos ( #50 )
2019-02-06 18:27:58 +01:00
Ștefan Talpalaru
1083b2972a
support Content-Type headers with specified charset
...
and add RPC message content to the debugging output (at the TRACE level,
disabled by default)
2019-01-28 12:39:27 +02:00
coffeepots
bb9896d693
Add closeWait to httpServer
2018-09-13 18:06:33 +01:00