如何在IRC的DCC协议中处理IPv6
在 IRC DCC 通信中,要启动连接,您必须向其他人提供 IP 地址和端口。然而,在 IPv6 世界中如何处理这个问题呢?
我正在用 Java 编写机器人的 IRC 框架部分,因此我需要能够处理各种情况。似乎没有一个标准的方法来处理这个问题
我对 IPv6 上的现有客户端做了一些测试(两个 Teredo 客户端通过 Ipv6 连接到
- Firefox 中的 freenode Chatzilla 不发送任何内容。它就像什么也没发生一样
- Xchat 只是发送 0作为 IP 地址,这是错误的,
我知道 DCC 协议有一些扩展可以以人类可读的格式发送 IP 地址,但这些扩展既不是标准的,也不是广泛支持的。现在
我正在将 IPv6 地址转换为 BigInteger,但另一方面,弄清楚 BigInteger 是 IPv4 还是 IPv6 地址却困扰着我(我稍后会问如何做到这一点) TL;DR: 在 IPv6 环境中处理 DCC 的正确方法是什么?我应该发送 0,还是
不应该发送任何内容并在机器人中引发不受支持的异常?我应该发送怪物 BigInteger 吗?
In IRC DCC communications to initiate a connection you have to provide an IP address and a port to the other person. However, how do you handle this in an IPv6 world?
I'm writing the IRC framework part of the bot in Java, so I need to be able to handle various situations. There doesn't seem to be a standard way to handle this
I did some tests with existing clients over IPv6 (two Teredo clients connecting to freenode over Ipv6
- Chatzilla in Firefox doesn't send anything. It just acts like nothing happened
- Xchat just sends 0 as an IP address, which is wrong.
I know that there are some extensions to the DCC protocol that send the IP address in human readable format, but those aren't standard nor widely supported. Sending 0 doesn't seem like the appropriate way to future proof my bot.
Right now I'm converting the IPv6 address to a BigInteger, but on the other end figuring out if the BigInteger is an IPv4 or IPv6 address is stumping me (I'm asking how to do that later).
TL;DR: What's the appropriate way to handle DCC in an IPv6 environment? Should I send 0, should I not send anything at all and raise exceptions in the bot that its unsupported, or should I send the monster BigInteger?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DCC 没有官方 RFC,因此唯一真正的权威文档是原始 CTCP 规范:
http: //www.irchelp.org/irchelp/rfc/ctcpspec.html
哪种假设采用 IPv4:
您可能想检查 mIRC 和 irssi 的作用,因为它们比 Chatzilla 和 XChat 更常用,并且可能提出了某种双方都可以接受的解决方案。
There's no official RFC for DCC, so the only real definitive document is the original CTCP spec:
http://www.irchelp.org/irchelp/rfc/ctcpspec.html
Which kind of assumes IPv4:
You may want to check what mIRC and irssi do, as they're more commonly used than Chatzilla and XChat, and may have come up with some sort of mutually acceptable solution.