rebol

Any simple standalone code sample for a websocket protocol (ws) implementation in rebol?


I read cheyenne server is going to implement it ( http://web.syllable.org/news/2010-01-02-22-16-WebSockets-for-Cheyenne-web-server.html ) , but for learning purpose I'd like more to see the shortest sample code of a websocket server and a websocket client in rebol / rebol or rebol / rebol view or rebol / javascript.

like this example in java http://blog.jwebsocket.org/2010/06/17/jwebsocket-instead-of-xhr-and-comet/

or this example in php http://blog.digitalbackcountry.com/2010/07/websocket-charting-demo-with-html5-and-javascript/

Could also Rebol include such protocol natively in some future like for the rest (http, ftp,...) ?


Solution

  • I write this by looking at this java example: http://github.com/adamac/Java-WebSocket-client/blob/master/src/com/sixfire/websocket/WebSocket.java

    and tested only with this ws chat server http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx

    it supports framing (0x00 - - 0xFF), when you pick the port it returns the last , if no msg then returns none. currently it does not support data frames (0x80 - 0xFE) and no support for utf8.

    Take it as an example.