Skip to content

Commit

Permalink
Reject https (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin969 committed Nov 4, 2023
1 parent 8f57f12 commit db15a81
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a
)

require golang.org/x/text v0.13.0 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce h1:4RwhE31
github.com/FlashpointProject/zipfs v0.0.0-20231103125305-60ba85d03bce/go.mod h1:ksRykBq1p588rPM2QwZXLvuB/HFiBqlHe3sJhTXhNIo=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021 h1:EbF0UihnxWRcIMOwoVtqnAylsqcjzqpSvMdjF2Ud4rA=
github.com/elazarl/goproxy v0.0.0-20220529153421-8ea89ba92021/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a h1:r72lWG/xCv9MLpRTss5BQVHDURXaaD6OwS2HkI5/+Ls=
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,13 @@ XgVWIMrKj4T7p86bcxq4jdWDYUYpRd/2Og==
goproxy.MitmConnect.TLSConfig = goproxy.TLSConfigFromCA(&cert)

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

Expand Down
2 changes: 1 addition & 1 deletion zipfs
Submodule zipfs updated 2 files
+1 −1 file_server.go
+25 −24 phpcgi.go

0 comments on commit db15a81

Please sign in to comment.