owise1 / ambient-weather-api

Ambient Weather API
21 stars 8 forks source link

.NET API Example #3

Open simplextech opened 5 years ago

simplextech commented 5 years ago

Can you provide information for a .NET usage?

owise1 commented 5 years ago

Unfortunately I'm not familiar with .NET. I'd think you could install nodejs and then use this library?

simplextech commented 5 years ago

We develop plugins for other systems and some of them are embedded and not able to install "extra" software. I'm working through it though.

Regards,

John Eubanks

Website: http://www.simplextech.net

E-Mail: jeubanks@simplextech.net

CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the individual(s) or entity to which it is addressed and may contain information that is privileged and confidential. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is prohibited. If you have received this communication in error, please notify me by return email.

On Mon, Aug 13, 2018 at 12:23 PM, Oliver Wise notifications@github.com wrote:

Unfortunately I'm not familiar with .NET. I'd think you could install nodejs and then use this library?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/owise1/ambient-weather-api/issues/3#issuecomment-412577759, or mute the thread https://github.com/notifications/unsubscribe-auth/Am-ZUYqJpeFiP5_Uk9pBdPzZ3HoBNhzTks5uQagAgaJpZM4V4Ydi .

simplextech commented 5 years ago

Here's what we see when doing the WebSocket connection from VB.Net

GET /?api=1&applicationKey= HTTP/1.1 Connection: Upgrade Host: api.ambientweather.net Upgrade: websocket Sec-WebSocket-Key: 3WJvmOgYlSx3y/Bh7wEBoA== Sec-WebSocket-Version: 13

The Sec-WebSocket-Key is random and changes each time.. I see nothing wrong with the request, and the expectation is to get a 101 response back. However, we get a 503 response..

owise1 commented 5 years ago

Hmm. I'm not sure. The realtime API uses socket.io, are you able to use a library like this? https://github.com/Quobject/SocketIoClientDotNet That might be easier that trying to do the websocket handshake manually

simplextech commented 5 years ago

This is being done with another library (commercial) and getting this error and strange behavior. I have not tried the mentioned library but I also did try WebSocket4Net and had issues as well.