xmpp interview questions
Top xmpp frequently asked interview questions
There seem to be several options for Python XMPP client libraries -- I'm not totally sure what I'm getting myself into (just fiddling around at this point), so I'm looking for some advice on which XMPP library has the most mature/Pythonic client API. (Or, to be more objective about it, an assessment of the relative strengths/weaknesses of the available libraries.) TIA!
Source: (StackOverflow)
I need a simple scriptable/commandline jabber client. What is the best and/or simplest one to install?
Clarification: I'm looking for a simple way to send messages from within a script.
Source: (StackOverflow)
I'm learning XMPP now but I repeatedly seeing that word roster but I have no idea. Hope someone can lighten me up!
Source: (StackOverflow)
What are your experiences with Python Jabber / XMPP client libraries?
What do you recommend?
Source: (StackOverflow)
//////////////////////////////////////////////////////////////////////////////////////////////////
// OBSERVE https://developers.facebook.com/docs/chat/
The service and API this document covers has been deprecated with the release of Platform API v2.0. Once version 1.0 is deprecated, chat.facebook.com will no longer be available.
// Read this and you probably want to do something completely different than anything that has to do with this question.
////////////////////////////////////////////////////////////////////////////////////////
I'm creating a chat with WebForms C# connecting to Facebook Chat API.
I have also looked at this SO question (and all links). Some parts are no longer relevant since Facebook requires auth_token
now.
To replicate this, you should set up a Facebook web app, use the appId
and a user account with xmpp_login permission set. Then create a Chat.aspx
with code behind and paste this code accordingly. And replace the hard-coded users to interact with.
I have two (maybe three) issues which I believe prevent me from succeeding with my goal to send a chat message.
- The process noted as
// finishes auth process
in the documentation does not match the documentation description
(I'm not getting any respones after I have received my SSL/TLS based success message from Facebook.)
- I have no idea how the 'send chat message'-part should be set up, and since I don't receive any messages from Facebook its hard to tell what might be wrong.
Here is my code in its entirety, on PasteBin.
I also have some helpers for adding xmpp_login permissions and such.. removed for clarity.
Global variables:
public partial class Chat : Page
{
public TcpClient client = new TcpClient();
NetworkStream stream;
private SslStream ssl;
private string AppId { get; set; }
public string AppSecret { get; set; }
public string AppUrl { get; set; }
public string UserId { get; set; }
public string AccessToken { get; set; }
private string _error = string.Empty;//global error string for watch debugging in VS.
public const string FbServer = "chat.facebook.com";
private const string STREAM_XML = "<stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\" xmlns=\"jabber:client\" to=\"chat.facebook.com\" xml:lang=\"en\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">";
private const string AUTH_XML = "<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='X-FACEBOOK-PLATFORM'></auth>";
private const string CLOSE_XML = "</stream:stream>";
private const string RESOURCE_XML = "<iq type=\"set\" id=\"3\"><bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"><resource>fb_xmpp_script</resource></bind></iq>";
private const string SESSION_XML = "<iq type=\"set\" id=\"4\" to=\"chat.facebook.com\"><session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/></iq>";
private const string START_TLS = "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>";
Then in Page_Load
all the steps required are (or are supposed to be) performed. Worth noting is the SendMessage("test");
. I just tried to put it there to see if it would succeed in sending a chat message... SetUserNameAndAuthToken
sets my auth token and user name to global variables. The AuthToken works.
protected void Page_Load(object sender, EventArgs e)
{
this.AppId = "000000082000090";//TODO get from appsettings.
//AddAdditionalPermissions("xmpp_login");//TODO handle xmpp_login persmission
this.AppSecret = "d370c1bfec9be6d9accbdf0117f2c495"; //TODO Get appsecret from appsetting.
this.AppUrl = "https://fbd.anteckna.nu";
SetUserNameAndAuthToken();
Connect(FbServer);
// initiates auth process (using X-FACEBOOK_PLATFORM)
InitiateAuthProcess(STREAM_XML);
// starting tls - MANDATORY TO USE OAUTH TOKEN!!!!
StartTlsConnection(START_TLS);
// gets decoded challenge from server
var decoded = GetDecodedChallenge(AUTH_XML);
// creates the response and signature
string response = CreateResponse(decoded);
//send response to server
SendResponseToServer(response);
SendMessage("test");
// finishes auth process
FinishAuthProcess();
// we made it!
string streamresponseEnd = SendWihSsl(CLOSE_XML);
}
So I get a response then I send the response to server:
private void SendResponseToServer(string response)
{
string xml = String.Format("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">{0}</response>", response);
string response2 = SendWihSsl2(xml);
if (!response2.ToLower().Contains("success"))
_error = response2;
}
This takes 1 minute 40 seconds... and response is:
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
Finally I do the FinishAuthPorcess()
private void FinishAuthProcess()
{
string streamresponse = SendWithSsl(STREAM_XML);
if (!streamresponse.Contains("STREAM:STREAM"))
_error = streamresponse;
string streamresponse2 = SendWihSsl(RESOURCE_XML);
if (!streamresponse2.Contains("JID"))
_error = streamresponse2;
string streamresponse3 = SendWihSsl(SESSION_XML);
if (!streamresponse3.Contains("SESSION"))
_error = streamresponse2;
}
All responses are ""
. Looking at the Read
method in SendWithSsl
: it's 0 bytes.
Trying to send a message also gives me 0 bytes Read data from Facebook. I have no clue as to why?
Source: (StackOverflow)
Facebook will be deprecating their chat API that currently allows sending chat messages via XMPP.
My company is currently working on a product that may take advantage of the chat API and I would like to know more about the future of this service.
Will the current XMPP-based chat API be replaced with a new version next year? Or is it going to be obsolete?
Any input on this will be appreciated!
Source: (StackOverflow)
I'm going through a bit of a re-think of large-scale multiplayer games in the age of Facebook applications and cloud computing.
Suppose I were to build something on top of existing open protocols, and I want to serve 1,000,000 simultaneous players, just to scope the problem.
Suppose each player has an incoming message queue (for chat and whatnot), and on average one more incoming message queue (guilds, zones, instances, auction, ...) so we have 2,000,000 queues. A player will listen to 1-10 queues at a time. Each queue will have on average maybe 1 message per second, but certain queues will have much higher rate and higher number of listeners (say, a "entity location" queue for a level instance). Let's assume no more than 100 milliseconds of system queuing latency, which is OK for mildly action-oriented games (but not games like Quake or Unreal Tournament).
From other systems, I know that serving 10,000 users on a single 1U or blade box is a reasonable expectation (assuming there's nothing else expensive going on, like physics simulation or whatnot).
So, with a crossbar cluster system, where clients connect to connection gateways, which in turn connect to message queue servers, we'd get 10,000 users per gateway with 100 gateway machines, and 20,000 message queues per queue server with 100 queue machines. Again, just for general scoping. The number of connections on each MQ machine would be tiny: about 100, to talk to each of the gateways. The number of connections on the gateways would be alot higher: 10,100 for the clients + connections to all the queue servers. (On top of this, add some connections for game world simulation servers or whatnot, but I'm trying to keep that separate for now)
If I didn't want to build this from scratch, I'd have to use some messaging and/or queuing infrastructure that exists. The two open protocols I can find are AMQP and XMPP. The intended use of XMPP is a little more like what this game system would need, but the overhead is quite noticeable (XML, plus the verbose presence data, plus various other channels that have to be built on top). The actual data model of AMQP is closer to what I describe above, but all the users seem to be large, enterprise-type corporations, and the workloads seem to be workflow related, not real-time game update related.
Does anyone have any daytime experience with these technologies, or implementations thereof, that you can share?
Source: (StackOverflow)
I am looking for a way how to retrieve archive of chat messages from google server via using XEP-0136 standard, but I got these results just trying to ask for the feature.
Request:
<iq type="get"><pref xmlns="urn:xmpp:archive"/></iq>
Response:
<iq xmlns="jabber:client" type="error" to="myEmail@gmail.com/9FF72CA7">
<pref xmlns="urn:xmpp:archive"/>
<error code="501" type="cancel">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
So it looks like google does not implement this feature, but is it true? I don't think so.
The same happened with trying to set invisibility which is definitely supported by Google server.
Request:
<iq type="set" id="invisible1" from="myEmail@gmail.com/00230F07">
<query xmlns="jabber:iq:privacy">
<active name="invisible"/>
</query>
</iq>
Response:
<iq xmlns="jabber:client" type="error" id="invisible1" to="myEmail@gmail.com/00230F07">
<query xmlns="jabber:iq:privacy">
<active name="invisible"/>
</query>
<error code="501" type="cancel">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
So probably I am doing something wrong. Any help will be appreciated.
Source: (StackOverflow)
Overview
I am sending messages back and forth between a client (Android phone) and a Server (Windows Server). Using a persistent connection over TCP, which protocol would be the best solution. I am looking at performance, scalability, size of messages, and battery life. The messages must arrive at the destination in order and can not be duplicates.
MQTT
This seems like the better solution, but there seems to be little examples of large implementation with lots of users. I am not sure if I can integrate this into the windows server, or if it would have to be another application or server running. Finally there seems to be a lack of information on it in general.
XMPP
This seems to have lots of implementation, examples, and even a book : ). However the main purpose seems to be for instant messaging clients and things like Google talk. Will this be an optimal solution to messaging between server and client. I know currently XMPP is mostly used in client to server to client architectures.
Please correct me if I am wrong and thanks in advance for any guidance.
Source: (StackOverflow)
I'm looking for a method to access Google Talk chat history. Method to be used for an android device but does not have to be specific to it. I am looking for preferably an official method, but this is not required. AFAIK there is no official method. The method must pecifically not,
- Through IMAP (requires chat and label to be enabled)
- Through Talk.apk's ContentResolver (requires that the talk.apk be installed)
unless it somehow bypasses the problems listed after the methods above.
Googles different Google Talk applications are able to do chat history but there is no documentation that im aware of to how this works.
Source: (StackOverflow)
Has anyone written an open source XMPP library that uses WebSockets and is meant to be run by a browser?
Source: (StackOverflow)
I was looking for JSON schema standards and their corresponding php implementations. Expecting some open source out there and I was surprised, to find only one php implementation. I was about using this technology (JSON) and the schema lib to parse my incoming browser requests.
This natural parse/validate activity seems natural in XML and make me wonder why this is not the case in JSON.
I end up with a doubt situation. Should I pursue my JSON structure data exchange or switch to XML? I first chose JSON for its simplicity and less verbose syntax compared to XML, but if I have to redevelop all existing standard in the world these arguments becomes lighter. I also chose JSON hoping to limit the size of communications between my web server and my mobile apps. Playing with comet apps, XMPP seems to be implemented and used by big names like Google, Facebook, for their real time chat chat text or video based messages.
So the actual questions are:
- Is JSON for the poor web server developer that wants to know what happen on its traffic, and focus on over simplicity (do not be mistaken, here, I include myself)?
- Does IETF draft for JSON schema is a serious work, since only few implementation exist on the server side (PHP)?
- Am I missing something, or maybe, the best communication pattern is to send data in xml to the server and expect a json response (many json schema implementation exist in javascript)?
- Or did I only faced the actual proof, that this concern has not been well served by the developer community because web developer using JSON do not test deeply their incoming request data?
Please help me understand, I am missing some experience here?
Source: (StackOverflow)
I'm thinking of building a multi-player game using GAE. When player A makes a move, I'd like to record the details and then let player B know about the move.
I thought that I might get some open-source XMPP library in my client and notify presence to my app if that is possible? I wouldn't want to force the player to sign-up to a service like google talk, so I'll generate jid's on the fly based on session id.
Would like to hear from you!
Thanks
Source: (StackOverflow)
i'm setting up a chat system for my niche social site and have decided on ejabberd for the server side, but i cannot find any decent web-based ajax clients. most seem to be abandoned years ago or simply do not work. i've looked at every single one here :
http://xmpp.org/xmpp-software/clients/
Is anyone running a live site and using an ajax-based client that they can vouch for that works and is in active development ? I do not mind paying for something, but I do not want to do any development work whatsoever.
thanks in advance.
Source: (StackOverflow)