I am working for a company that is using Google Chatback (anonymous chat with a support employee in my company's case) as the main chat service provider. This service uses the XMPP (formerly known as Jabber) protocol for sending and receiving messages.
Our company has ten support employee accounts, and they are accessible through the chatback service we have used on our website. The employees use both Mac OSX and Windows, along with different clients on the different OSes. The chat is also available through native apps on both Android and iOS.
We need a service for logging the chat sessions, and we have been looking into proprietary solutions, but these are not supported on the mobile platforms, and that's basically the dealbreaker.
The solution I have decided is to introduce another link in the message chain, that logs all messages. The idea is that the server sends through this proxy, that logs the messages according to which chat session it is, and then saves those logs in an appropriate manner. Currently they are storing all the logs in a Dropbox folder, which is an error-prone activity.
This would, in theory, allow our supporters to use whatever os/client they chose, and the logs would end up the same place.
Having conducted some tests using the Smack API, I have concluded that my XMPP client (Trillian on both Android and Windows) replies to the resource from which it last received a message. This means effectively that the very simple chat logger I have implemented simply gets ignored.
The test have been conducted using the code below coupled with another client that runs in parallel. Only one of the clients receives the message.
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "googlemail.com");
config.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
config.setSASLAuthenticationEnabled(true);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
Presence presence = new Presence(Presence.Type.unavailable);
connection.login("android_client_username", "android_client_pass");
Message message = new Message("my_test_email@gmail.com");
message.setBody("Hello World!");
connection.sendPacket(message);
connection.sendPacket(presence);
connection.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
if (packet instanceof Message) {
Message message = (Message) packet;
System.out.println(message.getBody());
}
}
}, new MessageTypeFilter(Message.Type.chat));
- Is it possible to create such a proxy using the Google Talk service i.e. without hosting our own XMPP server?
- Is it at all possible to listen in on all packets on the server remotely?
- If not, what alternatives are there for anonymous web-based chat clients that utilize an open protocol such as XMPP?
Thank you for your time.
I am not too sure if it will affect you and your service, but just for your information in past i have experienced 407 Proxy Auth. response code while trying to make cross domain text/xml ajax requests. Mostly if you are behind a firewall/http-proxy(squid) kind of environment. Solution to that is mostly fallback mode to jsonp when behind a proxy.
Test Verify: 1) setup local squid 2) use strophejs basic examples 3) setup cross domain ajax i.e. BOSH_SERVICE_URL domain is not same as requestor domain 4) configure browser to use local squid 5) You will find all POST api calls i.e. /http-bind text/xml calls will fail with 407 proxy auth response code 6) remove proxy-usage from browser 7) try again, everything works with CORS enabled
you can try gozerbot if you manage to configure it
If you DON'T USE the Google Chatback service it is relatively easy to set up the environment you need. In order to log XMPP messages, the chat must be done via MUC (multi-user-chat). You need the following components:
All this stuff can be found in the book, except for Perl script using Net::Jabber.
I was maybe not much of a help but if you decide to go this way, I'll help. If Google Chatback supports MUC, then all you need is Perl/Net::Jabber part.
EDIT: the perl XMPP daemon
Why not use XMPP over HTTP, then log the messages using an HTTP proxy (set all your XMPP clients to talk to the HTTP proxy rather than the endpoint directly)?