json_rpc/servers/httpserver

Search:
Group by:
Source   Edit  

Types

HttpAuthHook = proc (request: HttpRequestRef): Future[HttpResponseRef] {.
    async: (...raises: [CatchableError]).}
Source   Edit  
RpcHttpHandler = ref object of RpcServer
  maxChunkSize*: int
Source   Edit  
RpcHttpServer = ref object of RpcHttpHandler
Source   Edit  

Procs

proc addHttpServer(rpcServer: RpcHttpServer; address: TransportAddress;
                   socketFlags: set[ServerFlags] = {TcpNoDelay, ReuseAddr};
                   serverUri = Uri(); serverIdent = "";
                   maxConnections: int = -1; bufferSize: int = 4096;
                   backlogSize: int = 100; httpHeadersTimeout = 10.seconds;
                   maxHeadersSize: int = 8192;
                   maxRequestBodySize: int = defaultMaxMessageSize) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addHttpServer(server: RpcHttpServer; address: string) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Create new server and assign it to addresses addresses. Source   Edit  
proc addHttpServer(server: RpcHttpServer; address: string; port: Port) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addHttpServers(server: RpcHttpServer; addresses: openArray[string]) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addHttpServers(server: RpcHttpServer;
                    addresses: openArray[TransportAddress]) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Start a server on at least one of the given addresses, or raise Source   Edit  
proc addSecureHttpServer(rpcServer: RpcHttpServer; address: TransportAddress;
                         tlsPrivateKey: TLSPrivateKey;
                         tlsCertificate: TLSCertificate; socketFlags: set[
    ServerFlags] = {TcpNoDelay, ReuseAddr}; serverUri = Uri();
                         serverIdent: string = JsonRpcIdent;
                         secureFlags: set[TLSFlags] = {};
                         maxConnections: int = -1; backlogSize: int = 100;
                         bufferSize: int = 4096;
                         httpHeadersTimeout = 10.seconds;
                         maxHeadersSize: int = 8192;
                         maxRequestBodySize: int = defaultMaxMessageSize) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addSecureHttpServer(server: RpcHttpServer; address: string;
                         tlsPrivateKey: TLSPrivateKey;
                         tlsCertificate: TLSCertificate) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addSecureHttpServer(server: RpcHttpServer; address: string; port: Port;
                         tlsPrivateKey: TLSPrivateKey;
                         tlsCertificate: TLSCertificate) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc addSecureHttpServers(server: RpcHttpServer;
                          addresses: openArray[TransportAddress];
                          tlsPrivateKey: TLSPrivateKey;
                          tlsCertificate: TLSCertificate) {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Start a server on at least one of the given addresses, or raise Source   Edit  
proc closeWait(server: RpcHttpServer): InternalRaisesFuture[void, void] {.
    ...stackTrace: false, raises: [], gcsafe, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Cleanup resources of RPC server. Source   Edit  
proc localAddress(server: RpcHttpServer): seq[TransportAddress] {....raises: [],
    gcsafe, tags: [], forbids: [].}
Source   Edit  
proc new(T: type RpcHttpServer; authHooks: seq[HttpAuthHook] = @[]): T:type {.
    ...raises: [], gcsafe.}
Source   Edit  
proc new(T: type RpcHttpServer; router: RpcRouter;
         authHooks: seq[HttpAuthHook] = @[]): T:type {....raises: [], gcsafe.}
Source   Edit  
proc newRpcHttpServer(addresses: openArray[string];
                      authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Create new server and assign it to addresses addresses. Source   Edit  
proc newRpcHttpServer(addresses: openArray[string]; router: RpcRouter;
                      authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Create new server and assign it to addresses addresses. Source   Edit  
proc newRpcHttpServer(addresses: openArray[TransportAddress];
                      authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Create new server and assign it to addresses addresses. Source   Edit  
proc newRpcHttpServer(addresses: openArray[TransportAddress]; router: RpcRouter;
                      authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [JsonRpcError], raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Create new server and assign it to addresses addresses. Source   Edit  
proc newRpcHttpServer(authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
proc newRpcHttpServer(router: RpcRouter; authHooks: seq[HttpAuthHook] = @[]): RpcHttpServer {.
    ...raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
proc serveHTTP(rpcServer: RpcHttpHandler; request: HttpRequestRef): InternalRaisesFuture[
    HttpResponseRef, (CancelledError,)] {....stackTrace: false, raises: [], gcsafe,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc setMaxChunkSize(server: RpcHttpServer; maxChunkSize: int) {....raises: [],
    gcsafe, tags: [], forbids: [].}
Source   Edit  
proc start(server: RpcHttpServer) {....raises: [], gcsafe,
                                    tags: [RootEffect, WriteIOEffect],
                                    forbids: [].}
Start the RPC server. Source   Edit  
proc stop(server: RpcHttpServer): InternalRaisesFuture[void, void] {.
    ...stackTrace: false, raises: [], gcsafe, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Stop the RPC server. Source   Edit  

Exports

automaticBuiltinSerialization, METHOD_NOT_FOUND, call, json_rpc_workaround_24844_future_string, hash, flavorSkipNullFields, ResponseRx, readValue, RpcRouter, ==, writeRequest, readValue, RpcServer, mimeType, JrpcSys, writeValue, call, processsSingleResponse, new, rpc, flavorRequiresAllFields, automaticPrimitivesSerialization, ResponseError, RpcBatchResponse, createRpcSigsFromNim, hash, call, typeAutoSerialize, flavorEnumRep, executeMethod, RequestTx, prepareBatch, withPendingFut, executeMethod, JSON_PARSE_ERROR, ResponseRx2, decode, RpcBatchItem, createSingleRpcSig, readValue, INTERNAL_ERROR, flavorOmitsOptionalFields, readValue, flavorOmitsOptionalFields, readValue, automaticSerialization, wrapError, typeClassOrMemberAutoSerialize, GetJsonRpcRequestHeaders, route, automaticBuiltinSerialization, RequestParamsTx, Reader, send, Writer, RequestParamKind, RequestId, RpcClient, ResponseKind, createRpcSigsFromNim, defaultMaxMessageSize, ParamDescRx, RequestRx2, flavorAllowsUnknownFields, JrpcConv, writeValue, ResponseFut, typeAutoSerialize, executeMethod, Writer, writeValue, hasMethod, createRpcSigsFromString, close, RequestParamsRx, RpcRouterCallback, rpc, flavorRequiresAllFields, notify, decode, readValue, PreferredOutputType, $, createSingleRpcSig, mimeType, flavorEnumRep, clear, readValue, callBatch, clearPending, route, ParamDescNamed, processMessage, writeValue, flavorSkipNullFields, ResponseTx, hasMethod, writeNotification, readValue, PreferredOutputType, register, readValue, RpcBatchCallRef, unRegisterAll, JsonRPC2, flavorUsesAutomaticObjectSerialization, flavorEnumRep, shouldWriteObjectField, writeValue, flavorUsesAutomaticObjectSerialization, Reader, createRpcSigsFromString, flavorEnumRep, createRpcSigs, callOnProcessMessage, readValue, rpc, automaticSerialization, writeValue, ReqRespHeader, executeMethod, automaticPrimitivesSerialization, meth, notify, route, INVALID_PARAMS, INVALID_REQUEST, RequestRx, createRpcSigs, toTx, RequestIdKind, typeClassOrMemberAutoSerialize, rpc, RpcProc, ReBatchKind, register, readValue, writeValue, withWriter, route, flavorAllowsUnknownFields, RequestBatchRx, rpc, init, isFieldExpected, SERVER_ERROR, JSON_ENCODE_ERROR, RpcConnection, route, rpc