krohling / ArduinoWebsocketClient

Websocket client for Arduino
227 stars 72 forks source link

draft 10 handshake for node.js or tornado socket server? #4

Open chrisallick opened 12 years ago

chrisallick commented 12 years ago

I am trying to use this library with an ethernet shield to connect to WebSocket Server on my computer. It works with the most recent version of Chrome v16. Any chance of updating this library to support that? I ran the example and it did connect to echo.websockets.org, but I am guessing they are supporting really old prototcols.

When I try and connect to "10.1.2.10:8888/chatsocket" it hangs for a while then says not connected

krohling commented 12 years ago

Hi chrisallick, I do plan on updating the supported WebSocket protocol. Before working on that however, I'd like to complete the current version which adds support for Arduino 1.0 and Ethernet, which should be soon. Once that's complete, I'll be adding support for WiFly again and then focusing on the WebSocket protocol version.

perezd commented 12 years ago

Hey there, any idea what your ETA is on adding that? I'm happy to help, if I can.

chrisallick commented 12 years ago

Hey guys, here are some really awesome resources for moving forward with this. I actually am taking a crack at it myself although my C skills are rusty at best. Essentially a biggest thing that needs to happen is the frame creation based on the new spec. If you look at Square's new objective-c websocket library: SocketRocket you can see how they create the frames:

https://github.com/square/SocketRocket http://blogs.claritycon.com/blog/2012/01/18/websockets-with-rfc-6455/

krohling commented 12 years ago

Chris, Thanks for the info and I'd love to see what you come up with. Another challenging bit of functionality that needs to be written as well is adding support for the Sec-WebSocket-Key as it requires a SHA-1 hash. I've pasted a useful looking library below but it doesn't appear to support Arduino 1.0 yet.

Either way, I'm planning on implementing this but it will be after WiFly support which I'm planning to tackle next week. If you're able to make some headway please let me know!

http://code.google.com/p/crypto-arduino-library/source/browse/trunk/Sha1.cpp?spec=svn2&r=2

-kevin

On Feb 7, 2012, at 10:58 AM, Chris Allick wrote:

Hey guys, here are some really awesome resources for moving forward with this. I actually am taking a crack at it myself although my C skills are rusty at best. Essentially a biggest thing that needs to happen is the frame creation based on the new spec. If you look at Square's new objective-c websocket library: SocketRocket you can see how they create the frames:

https://github.com/square/SocketRocket http://blogs.claritycon.com/blog/2012/01/18/websockets-with-rfc-6455/


Reply to this email directly or view it on GitHub: https://github.com/krohling/ArduinoWebsocketClient/issues/4#issuecomment-3853876

perezd commented 12 years ago

Hey Kevin,

Might I suggest you add WiFly support using the following library: https://github.com/perezd/arduino-wifly-serial

I recently updated it to have support for arduino 1.0, and its working great for me. This seems far more reliable than the alternatives I've seen out there (been scouring the internet all day).

On Feb 8, 2012, at 10:49 PM, krohling wrote:

Chris, Thanks for the info and I'd love to see what you come up with. Another challenging bit of functionality that needs to be written as well is adding support for the Sec-WebSocket-Key as it requires a SHA-1 hash. I've pasted a useful looking library below but it doesn't appear to support Arduino 1.0 yet.

Either way, I'm planning on implementing this but it will be after WiFly support which I'm planning to tackle next week. If you're able to make some headway please let me know!

http://code.google.com/p/crypto-arduino-library/source/browse/trunk/Sha1.cpp?spec=svn2&r=2

-kevin

On Feb 7, 2012, at 10:58 AM, Chris Allick wrote:

Hey guys, here are some really awesome resources for moving forward with this. I actually am taking a crack at it myself although my C skills are rusty at best. Essentially a biggest thing that needs to happen is the frame creation based on the new spec. If you look at Square's new objective-c websocket library: SocketRocket you can see how they create the frames:

https://github.com/square/SocketRocket http://blogs.claritycon.com/blog/2012/01/18/websockets-with-rfc-6455/


Reply to this email directly or view it on GitHub: https://github.com/krohling/ArduinoWebsocketClient/issues/4#issuecomment-3853876


Reply to this email directly or view it on GitHub: https://github.com/krohling/ArduinoWebsocketClient/issues/4#issuecomment-3882941

perezd commented 12 years ago

Also, WRT websocket protocol support, I'll likely be using this websocket server: https://github.com/Worlize/WebSocket-Node

My understanding is that as long as you support the hybi-* segment of websockets, all of them will work at a minimum, with others having slightly fancier capabilities. The goal should be simply to remove hixie-* websocket specs, entirely, they are considered no longer relevant (except within safari, but that will change quickly).

perezd commented 12 years ago

Hey, checking in.

So my first stab at supporting WiFly was to use #ifdefs to replace the EthernetClient _client, with a WiFlyClient _client. So far, the definition of the new class is just enough to support the needs of this library (see gist: https://gist.github.com/30d46f96343ce8095548)

I'm implementing communcation with the wifly using this driver: https://github.com/perezd/arduino-wifly-serial, its pretty simple to use, and its worked for me by far the best out of all my trials (tried SFE version, the "real" ones, etc.), and as stated above, I patched this one to work with Arduino 1.0.

So, thats my plan, I've got a fork of this library going, and I'll push my branch tomorrow AM so you can review my progress and provide feedback/partner up with me?

Thoughts?

krohling commented 12 years ago

Hi Derek, That sounds great. Once you get your repo ready and pushed somewhere I'd love to take a look.

Thanks!

-kevin

On Feb 9, 2012, at 11:02 PM, Derek Perez wrote:

Hey, checking in.

So my first stab at supporting WiFly was to use #ifdefs to replace the EthernetClient _client, with a WiFlyClient _client. So far, the definition of the new class is just enough to support the needs of this library (see gist: https://gist.github.com/30d46f96343ce8095548)

I'm implementing communcation with the wifly using this driver: https://github.com/perezd/arduino-wifly-serial, its pretty simple to use, and its worked for me by far the best out of all my trials (tried SFE version, the "real" ones, etc.), and as stated above, I patched this one to work with Arduino 1.0.

So, thats my plan, I've got a fork of this library going, and I'll push my branch tomorrow AM so you can review my progress and provide feedback/partner up with me?

Thoughts?


Reply to this email directly or view it on GitHub: https://github.com/krohling/ArduinoWebsocketClient/issues/4#issuecomment-3902102

perezd commented 12 years ago

Here is the branch: https://github.com/perezd/ArduinoWebsocketClient/commit/abb1fc28a640fda35f319bc88de54815718bc1b1

I'm not very good at C++, so my code may not be perfect, sorry. Are you available in any sort of instant messaging fashion? ie: IRC, Gmail, AIM? We could chat more quickly about development stuff.

krohling commented 12 years ago

Hey Derek, by the way my GChat id is kevinrohling and feel free to email me directly at "kevin [at] kevinrohling dot com"

On Feb 10, 2012, at 11:08 AM, Derek Perez wrote:

Here is the branch: https://github.com/perezd/ArduinoWebsocketClient/commit/abb1fc28a640fda35f319bc88de54815718bc1b1

I'm not very good at C++, so my code may not be perfect, sorry. Are you available in any sort of instant messaging fashion? ie: IRC, Gmail, AIM? We could chat more quickly about development stuff.


Reply to this email directly or view it on GitHub: https://github.com/krohling/ArduinoWebsocketClient/issues/4#issuecomment-3912407