IRC "No Ident response"
I am trying to make a IRC client in Python and I got a problem with Ident.
I listen on port 113 for message from the Ident server, this works. The message looks like this: 49764 , 6667. But when I am sending the message back I get "No Ident response" (The message looks like the message in the RFC). Nothing that I tried has been working (Sending back to the IP and port that I got the message from, sending it to irc.freenode.net (The server I am connecting too) nor sending it to the IP I got the message from an开发者_StackOverflow社区d the port I got the message from (49764) works. And the RFC doesn't help me where to send the response to.lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
lsock.bind(("",113))
lsock.listen(5)
conn, addr = lsock.accept() #Conn = Connection to addr, addr = address and port that is connecting to me
msg = conn.recv(1024)
print msg #This is where I got 47964 , 6667
You are missing parts of the RFC. The request does indeed look like "49764, 6667", but your response need to be a little longer:
49764,6667:USERID:UNIX:Nicklas
Don't forget to terminate it with CRLF.
精彩评论