I'm currently working on a chat client which I'm building with the XMPP framework. I've explored the demo app and I noticed that when I enter my username/password, it's taking a very long time (about 15 seconds) to receive the connect and authentificate callbacks.
Is there a specific reason why it's taking so long to login and authenticate? Is it somehow possible to speed it up? Whatsapp or iChat for example is also using xmpp and it's very fast.
I'm using ejabberd as XMPP server on a Mac running 10.8 and xCode 4.4.
Thanks in advance!
Not sure about your case, but some clients had these kind of delays when they perform DNS lookup for the server' domain. The workflow is to first search for SRV records, as expected by the XMPP spec. If there is no SRV record for the domain, then fallback and try to connect to the domain directly, at the expected 5222 port. But that procedure of first trying with SRV and then fallback can consume a few seconds.
If this is your case, you could configure your client to connect to the server without doing SRV lookups, or correctly setup the SRV records for your domain.
SRV lookup takes the time thats why you are facing the problem
Resolve this by Setting [xmppStream setHostName: #"******"];
More explanation below
This hostName property is optional.
If you do not set the hostName, then the framework will follow the xmpp specification using jid's domain.
That is, it first do an SRV lookup (as specified in the xmpp RFC).
If that fails, it will fall back to simply attempting to connect to the jid's domain.
Following up on the email thread I agree with ppolv that DNS timeouts are likely related here. Do you have SRV entries configured for your domain? Are they correct? If you dump the traffic generated by Psi and Trillian do you see a difference in DNS requests between them?
Related
I'm setting up an iOS app to use the IP Messaging and video calling apis. I'm able to connect, create channels and setup a video call if I manually create hard-coded tokens for the app. However, if I want to use the PHP server (as described here https://www.twilio.com/docs/api/ip-messaging/guides/quickstart-ios) then I always get an error and it can't connect anymore.
I'm attaching a screenshot of what I see when I hit the http://localhost:8080 address which seems to produce a 500 Internal error on this URL: https://cds.twilio.com/v2/Streams
Thanks so much!
After much time spent on this I decided to try the node backend instead - under other server-side languages of the PHP and I have it running in 2 minutes! I used the exact same credentials as the ones that I was using on the PHP config file so either my PHP environment has something strange or the PHP backend needs some fixing. In any case, I'm able to move forward using the node backend, so if you run into the same issue just try node instead of PHP. woohoo!
I know in airports, for example, I've connected to their AP, and it pops up a browser window to log in on my device. Is it possible to do so with NodeMCU in lua, or even with c firmware?
This can accomplished by setting the DNS server for a connecting client [via DHCP] to a sort of DNS proxy. It doesn't need to be a fully featured DNS server, it only needs to be able to either return a static DNS answer for any host name query or forward the request to a real DNS server, to resolve host names as usual.
The static answer effectively hijacks web requests at the DNS level, by forging the DNS answer, causing all host names to resolve to the IP address of a local web server. That local web server ignores any Uri details and serves a login prompt for every request. It must also maintain a list of client MAC addresses that have authenticated.
NodeMCU does have a built-in DHCP server, as part of it's built-in WiFi AP, but running both a web and a DNS proxy in ESP8266's limited memory would be a hell of a trick. I think that two of them working cooperatively, interfaced using the SPI bus might be workable... maybe even three of them, one dedicated to maintaining the list of authenticated MACs, expiring them, etc.
Note that the only part of this I have done on an ESP 8266 is some very simple web server functionality, so it's mostly theory. If you try it I'd be very interested in hearing about it. :-)
You might want to try out CaptiveIntraweb project (https://github.com/reischle/CaptiveIntraweb) which is based on NodeMCU.
There is also thread (http://www.esp8266.com/viewtopic.php?f=32&t=3618) on ESP8266 community forum that discusses the solution details.
Asides from a constant 24/7 ping, how can I monitor a connection status to a site to ensure that it is up.
For example, 192.168.0.1 <-> 192.168.20.1, measuring the connection between these two sites.
I would suggest trying to simulate the usual actions you perform when you are working with the site. For example if the other site is mostly used as a file server I would write a script that will copy files to and from the site. If it is a web server then loading the main page every few minutes is a good idea.For authentication servers logging in is what you want.
Try to think about the most common functionality and simulate it.
I have an issue about apache server which is my server getting two access from unknown source every 5 seconds (exactly 5 seconds). One rails app is working on apache and getting log on either on apache and rails log. Using amazon aws as server and o and used load balance to share access to two server under 1 domain address. But either of them access repeatly.
Is there anything you know about this? (Sorry about bad english)
When you allocate an Elastic IP it is drawn from AWS pool of available addresses, and there is a chance it was used in the past, so it is not unusual to see traffic coming from bots, crawlers, old clients, etc...
I'm working on an app that uses Yahoo OAuth. The OAuth had been working fine but I just registered my domain with Yahoo and now it will not let me use the OAuth when I develop locally because
"Custom port is not allowed or the host is not registered with this consumer key."
The issue is because my call back URL is to a domain that is not registered with Yahoo (http://localhost:8080/welcome).
I'm not sure what to do. I'm also new to development so if you could be specific with suggestions that would be awesome! Any help is greatly appreciated.
Hiii... yahoo works on localhost :).. what you have to do is while registering for a yahoo consumer key and secret key, the registration page asks you what type of application is yours. I guess it gives you two options , website and the oder one as stand alone app. Choose stand alone app as in your case. Then it will give you a pair of keys, and it will work on localhost :). Enjoy!
It looks like Yahoo! doesn't want you to do this. Some answers from similar questions might be helpful (or not):
How do I develop against OAuth locally?
401 Unauthorized using Yahoo OAuth
Yahoo OAuth question
EDIT: more evidence Yahoo! doesn't support this: http://developer.yahoo.net/forum/?showtopic=6496&cookiecheckonly=1
I found the simplest solution was just to register for a separate key for my development environment. As long as you don't verify the domain for that key, you shouldn't hit any issues.
After many attempts, I too came to the conclusion that Yahoo's redirect_uri does not seem to work with ports other than 80.
The one solution that worked for me:
Download ngrok
Run the app and input ngrok http xxxx in the console - where xxxx is the port you are trying to access
The command will generate a http://xxxxxx.ngrok.io forwarding link that can be used for Yahoo's needs
Create a new Installed Application at https://developer.yahoo.com/apps/create/ and input http://xxxxxx.ngrok.io in the Callback Domain field.
Links should now work with this redirect_uri
Addressing Muhammad's comment in Vignes's answer here because I can't comment. You should be able to use a callback with a stand alone app if you specify 127.0.0.1 as the callback domain. You may also needed to change the port that your local server is listening to, because you cannot request that yahoo use e.g. port 8000. Make sure your local server is listening to port 80.
As of writing, setting the Application Type to Installed Application and then leaving the Callback Domain blank will give you errors.
What works is configuring 127.0.0.1 as the Callback Domain for the app. This works regardless if you are choosing Web Application or Installed Application as the Application Type. However, Yahoo! does not accept callback URLs with ports in it so you have to make sure your app listens to port 80 (or 443 if https) when running locally.
Another less ideal option would be using some random non-existent domain like local.dev.env.com as Callback Domain and then editing your hosts file by adding this:
127.0.0.1 local.dev.env.com
This will forward all requests on local.dev.env.com to 127.0.0.1.