Closed KAXER closed 9 years ago
Hi KAXER,
The jsconsole is using the javascript wrapper library (http://skynet.im/#javascript_api). You can call status() with a callback, you don't need to emit it.
conn.status(function(data){
console.log(data)
});
Your example would work if you were creating a direct socket.io connection. LMK if you run into any other troubles.
HI iamruinous, Thanks for your help. very useful tip. I'm trying also use the websockets API from MS-DOS, but I have this the answer : {"errot": "unauthorized"} when I use command curl -X GET: http://skynet.im/suscribe/UUID?token=xxxx
Could you said me what I'm doing wrong?
Thanks a lot in advance
Our REST API now requires UUID and token authorization passed in the headers rather than the querystring. Here is a curl example from our docs:
curl -X GET http://skynet.im/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b?token=123 --header "skynet_auth_uuid: {my uuid}" --header "skynet_auth_token: {my token}"
Hi Chirs, Please, give me the correct direction or advice , because I try but the same error happened-->{"error": "unauthorized"}
4.is it correct this line??: curl -X GET http://skynet.im/subscribe/37759f21-2f97-11e4-97c4-d1f36657f568?token=0vhikfgct52v2huxrzy9jd7k4qkyy14i/390ee421-2f94-11e4-97c4-d1f36657f568/ioike40hvm4sfw29xw0pmvqodvtmlsor
5.- {"error":"unauthorized"}
Also I tried with this line but I had the same result: curl -X GET http://skynet.im/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b?token=123/skynet_auth_uuid: {390ee421-2f94-11e4-97c4-d1f36657f568}/skynet_auth_token: {ioike40hvm4sfw29xw0pmvqodvtmlsor}
and this : curl -X GET http://skynet.im/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b?token=123 --header "skynet_auth_uuid: {390ee421-2f94-11e4-97c4-d1f36657f568}" --header "skynet_auth_token: {ioike40hvm4sfw29xw0pmvqodvtmlsor}" {"error":"unauthorized"}
Thanks a lot in advance
Try this:
curl -X GET http://skynet.im/subscribe/37759f21-2f97-11e4-97c4-d1f36657f568 --header "skynet_auth_uuid: 37759f21-2f97-11e4-97c4-d1f36657f568" --header "skynet_auth_token: 0vhikfgct52v2huxrzy9jd7k4qkyy14i"
The above curl example subscribes to only the device's broadcast messages where devices="*". This example subscribes to all messages (in and out):
curl -X GET "http://skynet.im/subscribe/37759f21-2f97-11e4-97c4-d1f36657f568?token=0vhikfgct52v2huxrzy9jd7k4qkyy14i" --header "skynet_auth_uuid: 37759f21-2f97-11e4-97c4-d1f36657f568" --header "skynet_auth_token: 0vhikfgct52v2huxrzy9jd7k4qkyy14i"
I tried , but appear culrl:(52) empty reply from server
Ah, the server is timing out the request. This API should behave like a streaming API waiting and listening for data. We'll take a closer look at this - thanks!
Awsome :+1: Thank to you...
Just added Connection: keep-alive to the HTTP headers on the subscribe and data streaming endpoints. The update is committed on GitHub and deploying to our AWS servers now...
Hi, Chirs, I'm trying to use the trick about the "socket open", using the Websocket API. But I have this messages:![image](https://cloud.githubusercontent.com/assets/7002588/4062993/3d4fdc56-2e04-11e4-8c32-08db7018fa31.png)
Could you said me what I'm doing wrong?
Thanks in advance :)