I am able to connect with my local server (prosody) but when i am trying to connect hosted server, i am unable to connect .
Here is my connection request
XMPPTCPConnectionConfiguration.XMPPTCPConnectionConfigurationBuilder builder =
XMPPTCPConnectionConfiguration.builder();
builder.setServiceName("my_service_name");
builder.setHost("xx.xx.xxx.xxx"); // my host name
builder.setPort(5281); // myport name (i have used 5281 for https as per the prosody docs )
builder.setUsernameAndPassword(mUsername, mPassword);
builder.setRosterLoadedAtLogin(true);
builder.setResource("Rooster");
mConnection = new XMPPTCPConnection(builder.build());
mConnection.addConnectionListener(this);
mConnection.connect();
mConnection.login();
When i am trying to connect , i am getting XmppPullparser exception as shown below , please help me.
W/AbstractXMPPConnection: Connection closed with error
org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT HTTP/1.1 400 Bad...@8:1 in java.io.BufferedReader@2d9e3b7)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:440)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:321)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1170)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:931)