hoxy icon indicating copy to clipboard operation
hoxy copied to clipboard

https with upstream proxy

Open jvmccarthy opened this issue 8 years ago • 3 comments

When using an upstreamProxy, https requests don't work. I'm getting the following error with NODE_DEBUG=net,

NET 17108: write failure { [Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
] code: 'EPROTO', errno: 'EPROTO', syscall: 'write' }

Looks like the issue is around ProvisionableRequest. The proxy assumptions are for http requests, which don't make a connect request for https.

Please consider using request since it handles proxying correctly for http and https. Sadly, I doubt I will be able to contribute a fix, but I wanted to submit an issue in case anyone else runs into this.

Thank you for all your efforts on hoxy. It is an important developer resource!

jvmccarthy avatar Sep 14 '16 20:09 jvmccarthy

Looks like you fixed it at https://github.com/jvmccarthy/hoxy/commit/71251f981800ed73b077f4a652c0c38794074c82 ?

mmaday avatar Nov 03 '16 20:11 mmaday

I tried to but ran into other issues with request and the connection management. It was somewhat working but after struggling with it for a few days, I had to pull off on my efforts. After struggling with it, I think it would probably be best to support plumbing through the https connect method manually instead of pulling in request. Sadly, because I was running out of time and this and websocket support wasn't working, I fell back to using Fiddler. I'm much rather use hoxy and hope to come back to it at some point.

jvmccarthy avatar Nov 07 '16 16:11 jvmccarthy

change protocol of request to http works for me.

proxy.intercept({
	phase: 'request'
}, function(req, resp, cycle) {
	req.protocol = 'http:';
});

wujichao avatar Feb 21 '17 16:02 wujichao