cannot make RPC call through WebSocket transport
See original GitHub issueI installed the version 6.5 and use this in the electron-quick-start sample project. While I cannot make any RPC call as the OutgoingRequest.isMethodCalled is always true.
const JSONRPC = require("jsonrpc-bidirectional");
const WebSocket = require("ws");
async function loadThroughJsonRPC() {
const defaultAPIEndPoint = 'ws://localhost:8080'
const ws = new WebSocket(defaultAPIEndPoint);
await new Promise((resolve, reject) => {
ws.on("open", resolve);
ws.on("error", reject);
});
const rpcClient = new JSONRPC.Client(defaultAPIEndPoint);
const webSocketTransport = new JSONRPC.Plugins.Client.WebSocketTransport(ws);
rpcClient.addPlugin(webSocketTransport);
var request = {
Name:'AccountService',
MethodName:'GetAccountCount',
Parameters:["1"]
};
await rpcClient.rpc("CallService", [request]);
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Notifications on a websocket transport trigger a timeout after ...
While the notification is formatted and sent to the web-socket as expected , it triggers a timeout after 5000ms since a response is...
Read more >rpc-websocket - npm
RPC WebSocket is a wrapper for standard websockets that adds support for message types, RPC, and for before/after send/receive events.
Read more >Android JSON-RPC tunneled in websocket - Stack Overflow
To "tunnel" JSON-RPC over that, for example, you could sub-class the JSONRPCClient class in android-json-rpc (overriding the doJSONRequest ...
Read more >Use JSON-RPC over HTTP, WebSocket, and IPC
To make RPC requests over WebSocket, you can use wscat , a Node.js based command-line tool. First connect to the WebSocket server using...
Read more >May I send request from Server to Client over WebSocket ...
I implement client-server RPC communication (client is not Web browser) and want to use JSON-RPC 2.0 spec over WebSocket. But what I don't...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

At last, I change to use react-scripts@2.0.0-next.66cc7a90 solves my issue.
OK, I find another issue with me, maybe should I open it as another issue?
I am using this package in a react app. and when i build it with react-scripts build && npm run release command, it gets build errors like this:
E:\Repos\BAE\src\electron\htmlui> npm run build
Creating an optimized production build…Failed to compile.
Failed to minify the code from this file:
Read more here: http://bit.ly/2tRViJ9 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bae-electron@0.1.0 build:
react-scripts build && npm run releasenpm ERR! Exit status 1npm ERR! npm ERR! Failed at the bae-electron@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\yingfand\AppData\Roaming\npm-cache_logs\2018-05-01T21_59_10_077Z-debug.log