Attempting fix for issue 244

This is an attempt to fix websocket-rails#244 as well as a better solution for websocket-rails#231