Skip to content

Commit 2f45a1e

Browse files
committed
Attempt to fix MITM CONNECT issue
1 parent cacc4f3 commit 2f45a1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iamlivecore/proxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ func createProxy(addr string, awsRedirectHost string) {
183183

184184
proxy := goproxy.NewProxyHttpServer()
185185
proxy.Logger = log.New(io.Discard, "", log.LstdFlags)
186-
proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
186+
proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile(`^(?:.*\.amazonaws\.com(?:\.cn)?)|(?:management\.azure\.com)|(?:management\.core\.windows\.net)|(?:.*\.googleapis\.com)$`))).HandleConnect(goproxy.AlwaysMitm)
187+
//proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
187188
proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { // TODO: Move to onResponse for HTTP response codes
188189
var body []byte
189190

0 commit comments

Comments
 (0)