2

I have created a program to send chat messages via socket between two ports in localhost. I need a third client who uses xmpp protocol to connect to localhost and sent message to here.When i run my server in terminal it shows this third client as connected

My code is given below:

import xmpp
msg='how r u :)'

client = xmpp.Client('localhost')
print "clienttttttttttttttttttt",client
con=client.connect(server=('localhost',5000))
#client.auth(username, passwd, 'botty')
#client.sendInitPresence()
message = xmpp.Message('localhost', msg)
print "messageeeeeeeeeeeeeeeeeeee",message
message.setAttr('type', 'chat')
client.send(message)

when i execute this code this error occurs

Registering protocol "error" as <class 'xmpp.protocol.Protocol'>(http://etherx.jabber.org/streams)
DEBUG: socket       sent  <?xml version='1.0'?>
  <stream:stream xmlns="jabber:client" to="localhost" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" >

Am using python xmpppy library.What is the issue here.How will i send my message to localhost which uses socket to send messages.Please help????

Vishnu
  • 324
  • 1
  • 3
  • 17
  • Please have a look to following answer http://stackoverflow.com/questions/910737/send-an-xmpp-message-using-a-python-library – Shreeyansh Jain Dec 10 '14 at 06:49
  • i saw that,but it for sending to gmail,i need to send message to localhost – Vishnu Dec 10 '14 at 06:52
  • 1
    I cannot see anything going wrong with your code. The debug log states the message was sent. What's the issue? Apart from that, what's the difference between sending XMPP stanzas to gmail.com and to an XMPP server running on localhost, except for the hostname? – Dominik George Mar 02 '15 at 09:31

0 Answers0