IPC as proxy of Main class instance


Hello there,

is that possible to use IPC (or another method) to access to a class instance in Main from the renderer view, like a proxy?

naive exemple:

// In main process.
var Foo = new FooBar()

ipcMain.on('ask-proxy', function(event, arg) {
  event.sender.send('proxy-reply', Foo)

// In renderer process (web page).
ipcRenderer.on('proxy-reply', function(event, arg) {
  console.log( typeof arg.someFooMethod); // prints "function"



Take a look at the remote API. I think it offers what you’re describing.


Thanks, that is exactly what I was looking for. :slight_smile: