File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,3 +82,5 @@ require (
8282 modernc.org/mathutil v1.7.1 // indirect
8383 modernc.org/memory v1.11.0 // indirect
8484)
85+
86+ replace github.com/lqqyt2423/go-mitmproxy => github.com/nnemirovsky/go-mitmproxy v1.8.11-0.20260412092537-661f1983cb97
Original file line number Diff line number Diff line change @@ -98,8 +98,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9898github.com/kr/text v0.2.0 /go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE =
9999github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw =
100100github.com/lib/pq v1.10.9 /go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o =
101- github.com/lqqyt2423/go-mitmproxy v1.8.10 h1:8hAP0xXBWtgHmFXs1oEsOG1klHB4fvNwrXrN+Uf7144 =
102- github.com/lqqyt2423/go-mitmproxy v1.8.10 /go.mod h1:dSGnI17tVZ8dtYu9vnaIz7kxVwJNFH0CoNQwEQlTpxE =
103101github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 =
104102github.com/mailru/easyjson v0.7.7 /go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc =
105103github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE =
@@ -114,6 +112,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9
114112github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 /go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8 =
115113github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w =
116114github.com/ncruces/go-strftime v1.0.0 /go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls =
115+ github.com/nnemirovsky/go-mitmproxy v1.8.11-0.20260412092537-661f1983cb97 h1:/UoDr3b4C1vUjUNwk5tmZiXd0S5IW/sJP2zwROmwzeA =
116+ github.com/nnemirovsky/go-mitmproxy v1.8.11-0.20260412092537-661f1983cb97 /go.mod h1:dSGnI17tVZ8dtYu9vnaIz7kxVwJNFH0CoNQwEQlTpxE =
117117github.com/oapi-codegen/runtime v1.3.1 h1:RgDY6J4OGQLbRXhG/Xpt3vSVqYpHQS7hN4m85+5xB9g =
118118github.com/oapi-codegen/runtime v1.3.1 /go.mod h1:kOdeacKy7t40Rclb1je37ZLFboFxh+YLy0zaPCMibPY =
119119github.com/oasdiff/yaml v0.0.0-20260313112342-a3ea61cb4d4c h1:7ACFcSaQsrWtrH4WHHfUqE1C+f8r2uv8KGaW0jTNjus =
Original file line number Diff line number Diff line change @@ -448,8 +448,13 @@ func (a *SluiceAddon) Requestheaders(f *mitmproxy.Flow) {
448448 if httpVer == "" && f .ConnContext .ClientConn .NegotiatedProtocol == "h2" {
449449 httpVer = "HTTP/2"
450450 }
451+ method := f .Request .Method
452+ if proto == ProtoWS || proto == ProtoWSS {
453+ method = "UPGRADE"
454+ httpVer = ""
455+ }
451456 verdict , err := checker .CheckAndConsume (connectHost , connectPort ,
452- WithRequestInfo (f . Request . Method , f .Request .URL .Path ),
457+ WithRequestInfo (method , f .Request .URL .Path ),
453458 WithProtocol (protoStr ),
454459 WithHTTPVersion (httpVer ),
455460 WithSkipBrokerRateLimit (),
Original file line number Diff line number Diff line change @@ -91,9 +91,13 @@ func FormatApprovalMessage(req channel.ApprovalRequest) string {
9191// for convenience; everything else defaults to http.
9292func schemeForApproval (req channel.ApprovalRequest ) string {
9393 switch req .Protocol {
94- case "https" , "wss" , "grpc" , "quic" :
94+ case "wss" :
95+ return "wss"
96+ case "ws" :
97+ return "ws"
98+ case "https" , "grpc" , "quic" :
9599 return "https"
96- case "http" , "ws" :
100+ case "http" :
97101 return "http"
98102 }
99103 if req .Port == 443 {
You can’t perform that action at this time.
0 commit comments