Closed tiptronic closed 3 years ago
Did someone manage to connect to RPC from a browser (not Node)?
If I do:
new WebSocket(`ws://127.0.0.1:${port}/?v=1&client_id=${this.client.clientId}`);
the socket is closed immediately with an an error 'Invalid Origin' (4001).
CloseEvent {isTrusted: true, wasClean: true, code: 4001, reason: "Invalid Origin", type: "close",
My application is whitelisted in the RPC and the above code works fine from Node or Electron (where I can specify the 'origin' explicitely when connecting to the Websocket... but I couldn't figure out, how to connect from a browser window...
Any ideas?
Did someone manage to connect to RPC from a browser (not Node)?
If I do:
new WebSocket(`ws://127.0.0.1:${port}/?v=1&client_id=${this.client.clientId}`);
the socket is closed immediately with an an error 'Invalid Origin' (4001).
CloseEvent {isTrusted: true, wasClean: true, code: 4001, reason: "Invalid Origin", type: "close",
My application is whitelisted in the RPC and the above code works fine from Node or Electron (where I can specify the 'origin' explicitely when connecting to the Websocket... but I couldn't figure out, how to connect from a browser window...
Any ideas?