I wonder how to use StropheJS to connect to a remote Openfire server?
Actually, I can connect to a local server using this:
$scope.connection = new Strophe.Connection('http://127.0.0.1:7070/http-bind/');
$scope.connection.connect($scope.jid, $scope.password, $scope.onConnect);
However, when I try connecting to a remote server, like this:
$scope.connection = new Strophe.Connection('http://172.21.2.217:7070/http-bind/');
$scope.connection.connect($scope.jid, $scope.password, $scope.onConnect);
the $scope.onConnect returns status of 1 (Strophe.Status.CONNECTING) and then status of 4 (Strophe.Status.AUTHFAIL).
The $scope.jid and $scope.password parameters work well when using Smack API to connect to remote Openfire server.
Thanks a lot!
Related
Trying to establish a data connection using REST from QlikCloud account to a locally running application. I get an errror:
Connection to local resources is not allowed
The application running on my laptop is having a REST API enabled.
I was not able to use QlikSense Desktop so I had to login through the browser to QlikCloud.
I also tried giving the ipaddress of my laptop instead of localhost. It still throws as error:
Connection to http://<ip_address>:1000/v1/documents?uri=/csv/myFile.csv is not allowed
Should I be running my application only on a server? Any help is appreciated.
The data connections are "executed" in the context of the Qlik Engine. Which means that when specifying localhost the connection will try and load the data from the machine where the Engine is running. In Qlik Cloud case - this will be some machine in Qlik's cloud.
You can:
use QS Desktop (you've mentioned that this is not working for you)
host your service somewhere on the interned where the Engine can reach it
use some service (like ngrok) that can tunnel the local server to a public url which then access from Qlik
Hi i am using openfire as my im server to my mobile app client, I have added the Httpfileupload plugin to openfire and enabled the http bind settings, when I try to upload a file it shows me this error Failed to connect to localhost/127.0.0.1:7443 ,
and the servers send me this XML message <get url="https://localhost:7443/httpfileupload/45726202-5e69-4b5c-a533-00d82f6d1121/4add76e7f15b6b4f.png"/>
I’ve tried to access this uri but it doesn’t work
please help me with this issues
i am using the latest smack version and the latest openfire version also
You appear to have set up Openfire using the value 'localhost' as its XMPP domain and/or fully qualified domain name for the server that is running Openfire. This is a recipe for disaster. Openfire is broadcasting the address of the content that is managed by its HTTP File Upload plugin, and uses the value that was configured, 'localhost'. Clients, which typically run on different machines, will try to connect to this host. As they're instructed to connect to 'localhost', they'll never be able to reach Openfire.
My advise is to setup Openfire again, and use proper, network-reachable addresses for values of the XMPP domain name and FQDN (these are asked for in the second page of the setup wizard, if memory serves).
I have a flask app running on a remote WINDOWS server (this server has a fixed ip address) which is not on my local network. The flask app is used to return some json data. The app works fine when I try to access the data while being logged into the remote server through request module in Python. However, when I try to run the same script on my personal laptop (which is not on the same network as the remote windows server), I get an error. However, when I try to ping the remote server from windows command prompt, I get the answer back. Can somebody tell in which direction should I go? I have no experience with web / api development.
response = requests.get("http://127.0.0.1:5000/product/1)
But instead of the local ip address, if I substitute the remote ip address, I don't get anything back.
Ok, so the problem lied with the remote firewall, it was blocking incoming connections. The moment I switched off the firewall, everything started working.
I am trying to connect to ejabberd server using smack API 4.1.2 (no asmack) on android device. while running smackClient program , I am getting below error
java.net.SocketTimeOutException:Failed to connect to abc.example.com/182.*.*.* (on port 5222) after 30000ms,'abc.example.com:5222' failed because java.net.ConnectionException: Failed to connect to abc.example.com/182.*.*.* (on port 5222) after 30000ms
Connection to same ejabberd server using same android device is working fine using xmpp clients like xabber. so Issue is surely with client code I have written. Below is the snippet of my code
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword(userName, password)
.setServiceName("abc.example.com")
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setSendPresence(true)
.build();
connection = new XMPPTCPConnection(config);
connection.connect();
connection.login(userName, password);
I am missing something in my client code that xabber is having so xabber connection is working from same device using same credential.
Please help
Hard to tell without real IP and names in your example. However, my best guess would be about how the address to your IP server is resolved.
There seems to be discrepancy in your example with server (example.com) and service name in your code (abc.example.com).
My guess it that your client is attempting to connect to another machine that the one the XMPP server is running on.
So, here are the things to check when you have issues with a server not replying:
Check how the address of the domain is resolved. You may need to specify another machine name that the domain. If this is a test domain, there is possibly not a DNS setup, so you may even need to specify server IP (while still configuring the client to use an XMPP domain, that's two different things).
In client, log the IP you are trying to connect to, to make sure this is the one where the server is running.
If server is not on the main domain server, you may even need to do DNS SRV record queries for XMPP C2S service.
For me , it took hours to find the solution.
I forget to turnoff the VPN application(Express VPN) .Network tunneling was the root cause .
And change the Network protocol version properties as below ,
Choose the 1st option (Obtain DNS server address automatically).
My experience: I used following code
DomainBareJid xmppServiceDomain = JidCreate.domainBareFrom("desktop-urvfr83");
//DomainBareJid xmppServiceDomain = JidCreate.domainBareFrom("192.168.1.3");
InetAddress addr = InetAddress.getByName("192.168.1.3");
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword("alir", "111111")
.setHostAddress(addr)
.setResource("phonn")
.setXmppDomain(xmppServiceDomain)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setPort(5222)
.build();
but it could not connect and produced timeout connection exception. When I disabled windows firewall it worked correctly and connected.
I want to setup a web chat client. I decided to use Candy. The XMPP server I'm using is Ejabberd. My Ejabberd server is local. The URL is :
http://localhost:5280/
Users are defined like this :
user#localhost
The thing is I can't connect to this server using Candy out of the box while I can connect to it with simple strophejs functions on my phone.
I compared the packets that were sent to the server and they are exactly the same :
On my phone using Wireshark :
The console log when I'm connecting with Candy :
The screen is pending on "Connecting..."
What can be the reason that I can't connect to the server ? Is there something I have to configure in ejabberd.cfg ?
Thanks for help
The default URL for BOSH on ejabberd is /http-bind
When configuring your BOSH client you should point to that directory on the correct web URL, not the ejabberd service root.
Using http://example.net:5280/http-bind as BOSH URL in your Web client configuration should work.