Unable to connect to facebook behind the proxy


I am trying to connect to facebook chat server from behind the proxy.I used the httpProxy provided by the smack.

Following is the proxy code i have used in my applicaiton

ProxyInfo proxyInfo = new ProxyInfo(ProxyInfo.ProxyType.HTTP,

proxy.xxx.com”, 8080, “username”, “password”);

ConnectionConfiguration config = new ConnectionConfiguration(

facebook.com”, 5222, proxyInfo);

When I run the application i get

XMPPError connecting to facebook.com:5222.: remote-server-error(502) XMPPError connecting to facebook.com:5222.

– caused by: org.jivesoftware.smack.proxy.ProxyException: Proxy Exception HTTP : Unknown Error

Can anyone please tel me where am I going wrong???