I checked sendb (not QtWebsocket) is faulty because during 
parsing the wd cmd for arguments, all data are converted to 
QString which is unicode rather than raw data. This is a bug 
and will be fixed.

However the part for receiving binary data should work (tested
with javascript websocket clients).

If I read spec correctly, text in websocket protocol means utf8
encoding.  Older websocket spec did not allow binary data so
that binary data have to be encoded to plain text at that time.
Current websocket spec (rfc 6455) allows binary data and there
is no more need to encode.

* https://tools.ietf.org/html/rfc6455

Пн, 17 фев 2014, Pascal Jasmin писал(а):
> 
> Is there a a thought that base64 should be applied before J code?  If base 
> 128 or base 196 is possible, then that would be an argument not to, because 
> there's no way to know what encoding the other side might be using.  An 
> alternative to 'text' or 'binary' for the 2nd parameter could be 
> 'text','binary','base64', 'base128', 'utf8encode'.
> 
> is utf8encode the 'standard' base128 encode?  Anyone know of a J 
> implementation?
> 
> websockify project https://github.com/kanaka/websockify/blob/master/README.md 
> originally developed in python but with C implementation, uses base64 for 
> binary encoding.  For some reason, the C implementation chooses not to 
> support binary transfer.
> 
> Also to partially answer my first question, google tells me, base128 is not 
> generally safe for transmitting over web, though base 85/91 exists, with 91 
> being patent free.
> 
> 
> 
> 
> 
> 
> ________________________________
> From: bill lam <bbill....@gmail.com>
> To: programm...@jsoftware.com 
> Sent: Monday, February 17, 2014 1:04:52 AM
> Subject: Re: [Jprogramming] Qt websockets and doevents
> 
> 
> 
> Also QtWebsocket may interpret and convert data as utf8 text but
> a. is not a legal utf8 string. I guess neither will other
> websockt server/client, eg javascript, will handle raw binary data 
> in the same manner as J. They either use equivelent of sendb or
> encode binary to plain text such as base64 in order to transmit/receive
> binary data.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to