websocket.inject_message 方法去哪儿了?

Where has the websocket.inject_message method gone?

docs 中它说我可以通过调用 flow.inject_message 将消息注入 websocket 流,但是当我尝试这样做时我得到了这个错误:

AttributeError: 'HTTPFlow' object has no attribute 'inject_message

查看 github,该方法似乎最近已在此 PR 中删除。该功能是否已移至其他地方或已完全删除?谢谢

当我们转移到新的 sans-io proxy core. I have coincidentally opened a pull request yesterday that brings it back (#4502 时,此功能已在 master 上暂时删除。新的 API 不同,但实现相同:

def websocket_message(flow):
    last_message = flow.websocket.messages[-1]
    if b"secret" in last_message.content:
        last_message.kill()
        ctx.master.commands.call("inject", [flow], not last_message.from_client, "ssssssh")