views:

33

answers:

2

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.

A: 

It was indeed a telnet protocol I was missing. Connecting as Raw instead Telnet solved the problem.

Alex Bliskovsky
Beat me by one second!-) Darn, I should have sent sooner rather than go around collecting and pasting useful URLs;-).
Alex Martelli
+5  A: 

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;-).

Alex Martelli
Thanks for the descriptive answer!
Alex Bliskovsky
@Alex, you're welcome! Many of us have puzzled over that "ÿûÿû" in the past (since putty is far from the only telnet client to try fancy negotiations and telnet's often used for testing purposes on servers that _don't_ do telnet protocols!-), it just took me 5 minutes to find a good explanation online!
Alex Martelli