The "-d" option sends the data as HTTP POST. XMPP is based on raw sockets. So you have to use a option which creates a plain persistent socket like telnet when available. But I am not that familiar with curl.
curl with talk.google.com via XMPP
-
02-12-2021 - |
문제
I would like to write a simple google talk client in C++ using libcurl.Google talk uses XMPP as communication protocol and it listens at talk.google.com:5222. First of all I try to access google talk from commandline 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 response 302 "The document has moved" If I try to use 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 again a valid XMPP response, the only problem is with talk.google.com.
Could someone point out my mistake?
해결책
제휴하지 않습니다 StackOverflow