var proxy = hoxy.createServer({
certAuthority: {
key: localhost.key,
cert: localhost.cert
},
tls: {
key: localhost.key,
cert: localhost.cert
}
}).listen(45682, () => {
console.log("Server started listening on port 45682");
});
proxy.log('error warn debug info', (event) => {
//console.error(event.level + ': ' + event.message);
//if (event.error) console.error(event.error.stack);
});
proxy.intercept("response", (req, resp, cycle) => {
console.log("Intercepted response");
win.webContents.send("response", {
req: req,
res: resp
});
});
proxy.intercept("request", (req, resp, cycle) => {
//console.log("Intercepted request");
});
I am making a proxy with Electron and I use this code
Before I added
tlsandcertAuthorityoptions it worked but only on HTTP now it doesn't work at all. I just getsite didn't send any dataerrors on my browser sometimesno interneterrors. Am I doing something wrong the certificates are forlocalhostand are in mylocalhostobject.