Python 如何使用mitmproxy编辑请求中的protobuf

Python 如何使用mitmproxy编辑请求中的protobuf,python,encoding,protocol-buffers,mitmproxy,Python,Encoding,Protocol Buffers,Mitmproxy,我不知道如何使用mitmproxy更改请求中的protobuf数据。我只有几天使用Charles和mitmproxy等工具的经验。我只需要更改protobuf数据的一个值。我该怎么做呢?到目前为止,我有这个 def request(self, flow: HTTPFlow): if flowfilter.match(self.filter, flow): ctx.log.alert(flow.request.path) # print(assemble_r

我不知道如何使用mitmproxy更改请求中的protobuf数据。我只有几天使用Charles和mitmproxy等工具的经验。我只需要更改protobuf数据的一个值。我该怎么做呢?到目前为止,我有这个

def request(self, flow: HTTPFlow):
    if flowfilter.match(self.filter, flow):
        ctx.log.alert(flow.request.path)
        # print(assemble_request(flow.request).decode('utf-8'))
        body = assemble_body(flow.request.data.headers, flow.request.data.content)
        print(bytes(body))

        ctx.log.alert('\n')
不太确定我的方向是否正确