连接到我的程序时出现奇怪的行为
我正在使用 Twisted 来实现某种服务器。当我测试它时,它收到的第一行总是很奇怪:(
Starting Server...
New connection from 192.168.1.140
192.168.1.140: ÿûÿû ÿûÿû'ÿýÿûÿý\NAME Blurr
192.168.1.140: \NAME Blurr
对于我发送的两个输入 \NAME Blurr
。)
这是打印输入的代码:
def lineReceived(self, line):
print "{0}: {1}".format(self.name, line)
我通过 Putty 通过 Telnet 连接到远程主机。这是我缺少的 telnet 协议还是什么?当我使用 Unix 的 telnet 程序并在本地连接时,第一行没问题。
I'm using Twisted to implement a server, of sorts. When I test it, the first line it receives is always strange:
Starting Server...
New connection from 192.168.1.140
192.168.1.140: ÿûÿû ÿûÿû'ÿýÿûÿý\NAME Blurr
192.168.1.140: \NAME Blurr
(for both inputs I sent \NAME Blurr
.)
This is the code that prints the input:
def lineReceived(self, line):
print "{0}: {1}".format(self.name, line)
I'm connecting via Putty through Telnet to a remote host. Is this a telnet protocol I'm missing, or what? When I use Unix's telnet program and connect locally, the first line is fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在此处找到“ÿûÿû之谜”的解释。简短形式:telnet 不是一个简单的协议,您所看到的是与不使用“telnettese”的服务器进行(试图)进行 telnet 协商的痕迹;-)。很好地猜测“这是我缺少的 telnet 协议吗”;-)
定义 telnet 协议所涉及的 RFC 链接自 此页面,如果您想进一步调试。我不是 putty 专家,所以我不知道如何告诉 putty 避免这种协商(并且像旧的简单 Unix telnet 客户端一样工作;-)。
You can find an explanation of the "ÿûÿû mystery" here. Short form: telnet is not a simple protocol, and what you're seeing is a trace of a telnet negotiation (trying to) occur with a server that doesn't speak "telnettese";-). Good guess about "is this a telnet protocol I'm missing";-)
The RFCs involved in defining the telnet protocol are linked from this page, if you want to debug further. I'm no putty expert so I don't know how to tell putty to avoid this negotiation (and act like the good old simple Unix telnet client;-).
这确实是我缺少的 telnet 协议。作为原始连接而不是 Telnet 连接解决了问题。
It was indeed a telnet protocol I was missing. Connecting as Raw instead Telnet solved the problem.