Native Websocket Connection in iOS

622 views
Skip to first unread message

Jared Mehle

unread,
Jul 20, 2011, 12:43:23 PM7/20/11
to juggernaut...@googlegroups.com
I am working on a Rails app that has both a web admin and an iPad client component. I've set up a Juggernaut server and have been able to successfully utilize it to deliver real-time poll results to a page within the web admin.

What we'd like to do is have the iPad application make a websocket connection and receive results in real-time just as the web page does. My first thought was to simply use a web view within the client and load a specialized page that would display the results. This would be almost identical to the page I've implemented within my Rails app already except the UI would be tailored for the iPad.

However, what we'd really like to do is keep all of the UI within the iPad application meaning it would need to make that websocket connection natively. I've come across a couple of libraries (ZIMT, UnittWebSocketClient) that say they support websocket connections, but the iOS developer I am working with claims he can not connect using them.

Does anyone have any experience with making native websocket connections from iOS?

Josh Morris

unread,
Jul 22, 2011, 7:07:39 PM7/22/11
to Juggernaut 2
What is the issue your developer is having with UnittWebSocketClient?
UnittWebSocketClient supports both the 00 and 07 versions of the web
sockets specification. What versions does your web server support?

On Jul 20, 10:43 am, Jared Mehle <jrme...@gmail.com> wrote:
> I am working on a Rails app that has both a web admin and an iPad client
> component. I've set up a Juggernaut server and have been able to
> successfully utilize it to deliver real-time poll results to a page within
> the web admin.
>
> What we'd like to do is have the iPad application make a websocket
> connection and receive results in real-time just as the web page does. My
> first thought was to simply use a web view within the client and load a
> specialized page that would display the results. This would be almost
> identical to the page I've implemented within my Rails app already except
> the UI would be tailored for the iPad.
>
> However, what we'd really like to do is keep all of the UI within the iPad
> application meaning it would need to make that websocket connection
> natively. I've come across a couple of libraries (ZIMT<https://github.com/esad/zimt>,
> UnittWebSocketClient<http://code.google.com/p/unitt/wiki/UnittWebSocketClient>)

Josh Morris

unread,
Sep 11, 2011, 12:52:28 PM9/11/11
to Juggernaut 2
I have done a little bit of homework and it looks like the version of
the server you are using is using the hixie75/76 version of the
specification. This is a woefully outdated version of the web socket
specification and is not compatible with the current specification. I
believe that Juggernaut is using a Node.js implementation of web
sockets. You might try using the https://github.com/asutherland/WebSocket-Node
implementation instead. It is also a Node.js implementation of web
sockets and should be rather straightforward to use in place of the
current server implementation. It supports rev07 of the specification
and should work well with the UnittWebSocketClient. Though it is
incompatible with the ZIMT library.

On Jul 20, 10:43 am, Jared Mehle <jrme...@gmail.com> wrote:
> I am working on a Rails app that has both a web admin and an iPad client
> component. I've set up a Juggernaut server and have been able to
> successfully utilize it to deliver real-time poll results to a page within
> the web admin.
>
> What we'd like to do is have the iPad application make a websocket
> connection and receive results in real-time just as the web page does. My
> first thought was to simply use a web view within the client and load a
> specialized page that would display the results. This would be almost
> identical to the page I've implemented within my Rails app already except
> the UI would be tailored for the iPad.
>
> However, what we'd really like to do is keep all of the UI within the iPad
> application meaning it would need to make that websocket connection
> natively. I've come across a couple of libraries (ZIMT<https://github.com/esad/zimt>,
> UnittWebSocketClient<http://code.google.com/p/unitt/wiki/UnittWebSocketClient>)
Reply all
Reply to author
Forward
0 new messages