2

I was able to use facebook chat with an external application using the following information:

First, find your Facebook username by going to http://www.facebook.com/your_user/. Next, Open iChat, then select iChat ยป Preferences and click on the Accounts tab.

Click on the + (plus) sign to add a new account, with these settings:

* Account Type is Jabber Account
* Account name is your_user@chat.facebook.com, and enter

your password * Click the drop-down arrow to reveal Server options. Enter chat.facebook.com as the server name. * Enter 5222 as the port and click Done.

Click Done again, and you are good to go.

From reading this, it seems that it might be possible to telnet into facebook chat. I tried, but wasn't able to. Is it possible? How?

tony_sid
  • 14,957

3 Answers3

6

There is no practical way to do this using a telnet client, as you would have to type all of the XML yourself, which is incredibly impractical. There are however several command-line XMPP clients available, as discussed in this stack overflow question.

List of Jabber Console Clients

If you are interested in learning about the XMPP protocol, I suggest you install Pidgin and take a look at the XMPP console by right-clicking on the Pidgin notification icon and choosing XMPP Console from the menu. All of the XMPP messages sent to and from your client will be shown, including every typing notification, status update, etc. It's very interesting to look at, and you can even try your hand at sending custom XMPP status codes from the console.

xmpp console pidgin

nhinkle
  • 37,661
2

From (very) limited testing, it seems possible.


Run telnet chat.facebook.com 5222 to connect, then proceed sending valid XML conforming to the Jabber protocol specification.

$ telnet chat.facebook.com 5222
Trying 69.63.181.105...
Connected to chat.facebook.com.
Escape character is '^]'.
<?xml version="1.0">
<stream>
// here I was looking up auth
Connection closed by foreign host.

Be aware that the server closes your connection within about a minute of inactivity, so looking up the protocol ad-hoc isn't practical. Or anything related to raw Jabber, as typing XML flawlessly isn't that easy, and once you send malformed XML, the connection closes immediately.

$ telnet chat.facebook.com 5222
Trying 69.63.181.105...
Connected to chat.facebook.com.
Escape character is '^]'.
<stream>
<?xml version="1.0"?><stream:stream id="5D13A2D5" from="chat.facebook.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en"><stream:error><invalid-namespace xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error></stream:stream>Connection closed by foreign host

If you want to suffer while chatting, a command-line client might be a better option. Alternatively, create a minimal client yourself, if it's about the protocol, so you don't have to type the XML under pressure -- and you don't suffer from the Telnet differences.

Daniel Beck
  • 111,893
1

Using telnet probably won't work as well as you'd like it to -- you probably mean a "raw socket connection." If you know the Jabber protocol really really well, you can do it with PuTTY:

  • putty -raw chat.facebook.com 5222

The best thing to do is to just get a Jabber client and connect to the hostname chat.facebook.com with it.