Do you have any sample code for logging in? I have some code where I am able to connect but not log in:
public BOSHConnection login(String host, int port, String user, String password, String domain, String filepath)
{
BOSHConnection connection = null;
try
{
BOSHConfiguration config = new BOSHConfiguration(false, host, port, filepath, user + "@" + domain);
config.setCompressionEnabled(true);
// config.setSASLAuthenticationEnabled(true);
connection = new BOSHConnection(config);
output(Data.INFO, "Attempting to connect to host " + host + ", port " + port);
connection.connect();
output(Data.INFO, "Connection to host " + host + ", port " + port + " successful.");
output(Data.INFO, "connection.isConnected() = " + connection.isConnected());
//connection.loginAnonymously();
output(Data.INFO, "Attempting to log in username " + user + ", password " + password);
connection.login(user, password, "dummy");
output(Data.INFO, "Logging in username " + user + ", password " + password + " successful.");
//connection.addPacketListener(new SmackMessageListener(connection, echoReply), new MessageTypeFilter(Message.Type.chat));
}
catch (Throwable t)
{
t.printStackTrace();
connection = null;
}
return connection;
}
No exception is thrown when I call connect(), connection.isConnected() = true is printed but when it tries to log in, I immediately get :
java.lang.IllegalStateException: Not connected to server.
Thank you.
In order to be really useful, this will also require HTTP proxy support. With this in place, smack/spark would work inside most corporate firewalls.