Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with HTTPS #107

Open
IceHacks opened this issue Jul 24, 2018 · 1 comment
Open

Not working with HTTPS #107

IceHacks opened this issue Jul 24, 2018 · 1 comment

Comments

@IceHacks
Copy link

I am making a proxy with Electron and I use this code

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");
});

Before I added tls and certAuthority options it worked but only on HTTP now it doesn't work at all. I just get site didn't send any data errors on my browser sometimes no internet errors. Am I doing something wrong the certificates are for localhost and are in my localhost object.

@wenzhhu
Copy link

wenzhhu commented Apr 2, 2020

remove this and give it another try

tls: {
		key: localhost.key,
		cert: localhost.cert
	}

And you need to make your browser trust your private CA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants