Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setupRpc() {
if (this.isInVsCode()) {
// eslint-disable-next-line
window.vscode = acquireVsCodeApi()
this.rpc = new RpcBrowser(window, window.vscode)
this.initRpc()
} else {
const ws = new WebSocket("ws://127.0.0.1:8081")
ws.onopen = () => {
this.rpc = new RpcBrowserWebSockets(ws)
this.initRpc()
}
}
},
initRpc() {