Added HTTP afterRead code (WIP)

This commit is contained in:
coffeepots 2018-06-21 18:39:47 +01:00
parent 7839a553a5
commit b632cbfb25

View File

@ -8,8 +8,11 @@ defineRpcTransport(httpProcessClient):
write:
let
msg = &"Host: {$client.localAddress} Content-Type: application/json-rpc Content-Length: {$value.len} {value}"
debug "Http stream", msg = msg
debug "Http write", msg = msg
client.write(msg)
afterRead:
# TODO: read: remove http to allow json validation
debug "Http read", msg = value
proc newRpcHttpServer*(addresses: openarray[TransportAddress]): RpcHttpServer =
## Create new server and assign it to addresses ``addresses``.