[
https://issues.apache.org/jira/browse/DIRMINA-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494604#comment-13494604
]
dhruv chopra commented on DIRMINA-907:
--------------------------------------
I looked at the http codec. From what I understand it is useful where the
client and server are speaking in HTTP and the business logic is built on top
of HTTP requests/responses (REST for example).
In the case of websockets, the client (browser) and the server don't speak HTTP
when sending/receiving data. Only the connection establishment handshake is
done using HTTP. Once the handshake is done, the actual data exchanged on that
very IoSession has its own encoding/decoding protocol which has nothing to do
with HTTP - in fact it is a binary protocol. I have attached an image in which
I've tried to illustrate the two different scenarios - please excuse my poor
paintbrush skills :-)
IMHO, there is no real need to make the two codecs work together as they are
for two different application scenarios. Mixing them will give us a codec with
lots of if/else blocks. e.g.: if(msg is WebSocket HANDSHAKE) if(plain HTTP
request) if (Websocket binary data)
> Create a WebSocket iofilter for use in Apache Mina TCP servers
> --------------------------------------------------------------
>
> Key: DIRMINA-907
> URL: https://issues.apache.org/jira/browse/DIRMINA-907
> Project: MINA
> Issue Type: New Feature
> Components: Filter, Protocol - HTTP, Transport
> Reporter: dhruv chopra
> Attachments: MinaCodecUsage.png, WebSocketFilter.zip
>
>
> Shephertz has created a websocket iofilter that can be added in Apache mina
> tcp server chain. The features of this codec are
> 1) Works with binary data sent/received over websocket
> 2) Abstracts the client details from the Handler code i.e. the handler need
> not be aware that the remote endpoint is a browser or native client.
> 3) Tested with binary data sent/received on latest chrome and firefox
> browsers. IE 9 doesn't support websockets and we will make changes if
> required for IE 10 when its released and if it supports websockets.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira