MtGox socket.io streaming - api

MtGox Streaming API is down or is something wrong with the code?
I used this example https:// bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master
You can test here http://atc.leadsoft.eu/test.html
I entered the server url (https://socketio.mtgox.com/mtgox) and click connect, but most of the time it writes only Connected or Connection timeout and freezes.

Related

How to connect to WSS with authorize ID in Advanced Rest Client

I'm absolutely new in WS but have experience with HTTP.
I need to test the WebSocket application and I want to connect to WSS with Advanced Rest Client and manually send some requests (as I do it in Postman to test Rest API).
The authentication is realized with using ID what looks like
xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx and it keeps in the local storage of my browser.
and my WSS server URL looks like wss://test.test.eu
When I trying to connect to wss://test.test.eu I received an Unknown Error. I understand what it is because of I need to provide the authentication ID to the server. So, I have this ID in xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx format.
I tried to connect to wss://test.test.eu/xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx but it doesnt work.
Can anybody help me - how can I use my ID what keeps in the local storage?

Keep alive a SSL connection on iOS

Here is my work flow for an app on iOS 8:
I open an UIWebView
Open a webpage
Server requires authentication.
I authenticate to the server using a client certificate stored in a p12 file.
I can access all the pages stored on the server with no problem (BTW, the site is single paged, and makes AJAX request to the server)
If I leave my app idle for 10 minutes, I can no longer make any request, and get this error message in the console
CFNetwork SSLHandshake failed (-9824 -> -9829)
NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9829)
Now, I understand this is because the TSL session expires after 10 minutes on the device and I have to open it again. How can I do that? I don't get any callbacks in my code.
Related to this issue is this article: https://developer.apple.com/library/mac/qa/qa1727/_index.html

Receive offline message with XMPP

I am working on a chat app using XMPP Protocol.
I tried following
this tutorial from github . Everything is working fine using
XMPP.
But I'm unable to receive offline messages when user comes
online.
As user A is logged out and user B sends messages to user A, and when user A logs into app, it must receive all the messages that
were sent by user B during offline session.
How can I receive these offline messages?
My app is totally stuck on this issue. Please help if anyone
knows the solution. Any help will be appreciated. Thanks
You need to enable mod_offline on server, if you are using ejabberd XMPP Server.
Here is the code needs to enable module:
ignore_pep_from_offline: true
max_user_offline_messages:
admin: 5000
all: 100
mod_offline:
access_max_user_messages: max_user_offline_messages
Write this code in ejabberd.yml config file.
It will store unto 100 messages per user received when client was offline.
At client side, you may have to register for service:
'http://jabber.org/protocol/disco#info'
If you done this, whenever offline client gets online, server will send those stored messages to respective client.
You've to send Request for offline message if server supports. XMPP works on TCP protocol so as soon as client is up, it should send request to server.
<iq type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://jabber.org/protocol/offline'/>
</iq>

Pubnub and Multiple XHR requests

I created simple webpage with a pubnub (3.4) subscription, about every 5 minutes I see an XHR request to pubnub from my Chrome console. Is this correct behavior? Thanks for any insight!
In doSubscribe
XHR finished loading: "https://ps3.pubnub.com/time/0". pubnub-3.4.min.js:11
XHR finished loading: "https://ps2.pubnub.com/time/0". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/0?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/13569794952114592?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/13569794952114592?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
Yes, this is expected as PubNub uses HTTP Long-Polling for communication between the client and server.
ANSWER: PubNub and Multiple XHR requests
These 5 minute responses you show are PINGS from PubNub Cloud. Yes this is expected and correct behavior. Read more below to learn about how PubNub streams data to your client like Google Chrome. Also see What are the Blank Messages my Application Keeps Receiving to learn a bit more. Continue reading for the specifics:
PubNub Socket Connections
PubNub JavaScript client for mobile and web browsers like Chrome (webkit) maintain a socket connection that will last for one hour and up to 24 hours depending on the network traffic. Connections are refreshed after 24 hours and will automatically reconnect with reliable data deliverability (Catch-up Missed Messages). This is because PubNub maintains a Cloud Queue for your clients which re-delivers any missed messages.
PubNub Dropped Connection Catch-up
PubNub uses Cloud Queues to maintain messages in-memory until the data has been delivered to your client device like Google Chrome. So if you drop your connection, you will still receive the data sent during the offline state and once the connection has been restored, you will receive your messages.
PubNub XHR Pings and Requests
In your Chrome Dev Console you will see pings every 300 seconds which is 5 minutes. These pings are an Application Layer transport protocol that ensures the data stream is still active and alive. This is helpful in states of internet loss and restoration. This allows better-than TCP-KeepAlive connectivity and improved reliability. During Data Transmission Cycle, the connection state is maintained as described in the previous section with connections laster up to 24 hours before they are recycled.

Magento REST API not working in PHP

Whenever I try to call Magento's rest resources via PHP, I get an HTTP 500 Internal Server Error. My link is, in accordance to Magento's REST API, http://mymagento.com/api/rest/products.
Everything is set up properly and whenever I try to access it via the browser, the response is a page with the XML data I want. Same thing goes for the RESTClient plugin for Firefox.
I also get the internal server error whenever I try to do an authorised request as a customer.
Does anyone know why this is happening? I ran out of ideas an hour ago or so.
If you just got that problem (only) then,
500 errors in the HTTP cycle
Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with the Web server:
Obtain an IP address from the IP name of the site (the site URL
without the leading 'http://'). This lookup (conversion of IP name to
IP address) is provided by domain name servers (DNSs).
Open an IP socket connection to that IP address.
Write an HTTP data stream through that socket.
Receive an HTTP data stream back from the Web server in response.
This data stream contains status codes whose values are determined by
the HTTP protocol. Parse this data stream for status codes and other
useful information.
This error occurs in the final step above when the client receives an HTTP status code that it recognises as '500'. (Last updated: March 2012).
Fixing 500 errors - general
This error can only be resolved by fixes to the Web server software. It is not a client-side problem. It is up to the operators of the Web server site to locate and analyse the logs which should give further information about the error.