如何使用 Twisted 记录通道上的所有 IRC 数据?
我有一个有点独特的要求。我想要做的是在特定端口上侦听通过 IRC 协议通过的所有流量。然后我想记录所有这些消息/命令/等。但是,我不想加入该频道。我只想听并记录。有没有一种简单的内置方法可以做到这一点?我一直在扭曲中查看 irc.IRC 和 irc.IRCClient 类,但它们似乎都太高级了,无法做到这一点。执行此操作的唯一方法是简单地下降到基本 Server 类,还是我仍然可以利用twisted 的一些更高级别的功能?
I have a somewhat unique request. What I am looking to do is listen on a specific port for all traffic coming through via IRC protocol. I then want to log all of those messages/commands/ect. I do not, however, want to join the channel. I just want to listen and log. Is there an easy built in way to do this? I have been looking at the irc.IRC and irc.IRCClient classes in twisted but they both seem too high level to do this. Is the only way to do this to simply descend to the base Server class, or can I still leverage some of the higher level functionality of twisted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们以某种迂回的方式解决了这个问题。我们开发了一个用 Twisted 构建的通用十六进制转储代理服务器,然后创建了更精细的解析算法。
We addressed this issue in a somewhat round about way. We worked off a generic hexdumping proxy server constructed in twisted and then created finer detail parsing algorithms off of that.
如果您只是连接到服务器,我认为您无法执行此操作...服务器不会向您发送您尚未加入的频道的消息。或者你是服务器的主机?
I don't think you can do this if you just connect to a server... the servers don't send you messages for channels you haven't joined. Or are you the host of the server?