I'm attempting to make a function that would allow for triggering a script in a V8 instance of Node from a node-chakracore instance. I'm doing this by running a newer version of Node as a child process. I want to do this in a way that it only has 1 newer Node instance instead of creating another one for every script I want to run. I want to have a runV8Script
function that would trigger the script on the V8 side. The way that I'm wanting to trigger scripts is by having an IPC socket, the server side being Chakra and the client side being V8.
The issue that I'm having is that I can't think of how I could use client
outside of the server callback which means I can't have a function send data.
I'm just creating this server with the simple code below, nothing fancy
let server = net.createServer(client => {
// The client can only be used inside of this callback
});