Skip to content

Commit db15a81

Browse files
committed
Reject https (for now)
1 parent 8f57f12 commit db15a81

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce
7-
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021
7+
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a
88
)
99

1010
require golang.org/x/text v0.13.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce h1:4RwhE31
22
github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce/go.mod h1:ksRykBq1p588rPM2QwZXLvuB/HFiBqlHe3sJhTXhNIo=
33
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
44
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021 h1:EbF0UihnxWRcIMOwoVtqnAylsqcjzqpSvMdjF2Ud4rA=
6-
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
5+
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a h1:r72lWG/xCv9MLpRTss5BQVHDURXaaD6OwS2HkI5/+Ls=
6+
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
77
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=
88
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
99
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,13 @@ XgVWIMrKj4T7p86bcxq4jdWDYUYpRd/2Og==
332332
goproxy.MitmConnect.TLSConfig = goproxy.TLSConfigFromCA(&cert)
333333

334334
// Handle HTTPS requests (DOES NOT HANDLE HTTP)
335-
proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
335+
proxy.OnRequest().HandleConnect(goproxy.AlwaysReject)
336336
proxy.OnRequest().HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) {
337337
_, resp := handleRequest(req, ctx)
338-
resp.Write(client)
338+
err := resp.Write(client)
339+
if err != nil {
340+
fmt.Printf("Error writing response to client: %s\n", err)
341+
}
339342
client.Close()
340343
})
341344

zipfs

0 commit comments

Comments
 (0)