Curl with talk.google.com via XMPP

I would like to write a simple Google Talk client in C ++ using libcurl.Google talk uses XMPP as the communication protocol and it listens on talk.google.com/10222. First of all, I'm trying to access google conversation from the command line using curl. If i try

curl talk.google.com:5222 -d "<stream:stream to='gmail.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' version='1.0'>" 

I get an answer 302 "The document has moved" If I try to use the telnet client

 telnet talk.google.com 5222 

I can get a valid XMPP response Also, if I try to access chat.facebook.com:

 curl chat.facebook.com:5222 -d "<stream:stream to='chat.facebook.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' version='1.0'>" 

I get a valid XMPP response again, the only problem is with talk.google.com.

Can anyone point out my mistake?

+4
source share
1 answer

The -d option sends data as an HTTP POST. XMPP is based on raw sockets. Therefore, you should use an option that creates a simple persistent socket, such as telnet, when available. But I am not familiar with curls.

+2
source

All Articles