You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "dhruv chopra (JIRA)" <ji...@apache.org> on 2012/10/16 21:15:02 UTC

[jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

    [ https://issues.apache.org/jira/browse/DIRMINA-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477267#comment-13477267 ] 

dhruv chopra commented on DIRMINA-907:
--------------------------------------

The attached filter will abstract the client connection from the handler. ie the handler will only decode/encode if the remote client is a websocket (which it knows depending on if a websocket handshake has been performed or not).
                
> 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: 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

Re: [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

Posted by Dhruv Chopra <dh...@shephertz.co.in>.
We don't have standalone test for this.. But I just put together a simple
connect/send/receive one - I'm attaching the client html file to use for a
simple test (open in ff or chrome).

You can use the Mina
TimeServer<http://mina.apache.org/quick-start-guide.html>example to
see the filter code in action (with some minor modifications).
After you've added the websocket codec code to your project. Just replace
'main' function and messageReceived with the following...

*public static void main(String[] args) throws IOException {*
*        IoAcceptor acceptor = new SocketAcceptor();*
*        SocketAcceptorConfig cfg = new SocketAcceptorConfig();*
* cfg.getFilterChain().addLast("wscodec", new ProtocolCodecFilter(new
WebSocketCodecFactory()));*
*        acceptor.bind( new InetSocketAddress(12346), new
TimeServerHandler(), cfg);*
*        System.out.println("MINA Time server started.");*
*}*
*
*
*    @Override*
*    public void messageReceived(IoSession session, Object message) throws
Exception {*
*        IoBuffer buf = (IoBuffer)message;*
*        System.out.println("received "+buf.array().length+" bytes");*
*        // send [0 0 0 1] to the client.*
*        byte[] resp = new byte[4];*
*        resp[3] = 1;*
*        *
*        session.write(WebSocketCodecPacket
.buildPacket(IoBuffer.wrap(resp)));*
*    }*

-Dhruv

On Tue, Oct 23, 2012 at 6:36 PM, Julien Vermillard <jv...@gmail.com>wrote:

> Hi,
> I took a look at it but it miss tests.
> do you have some tests to provide ?
> Julien
>
> On Tue, Oct 23, 2012 at 12:15 PM, Emmanuel Lécharny <elecharny@gmail.com
> >wrote:
>
> > Le 10/23/12 11:53 AM, Dhruv Chopra a écrit :
> >
> >  Hi Folks,
> >>
> >> Wanted to check if anyone has had a chance to play with the code we
> >> submitted for this filter.
> >> In case some information is incomplete, please let me know.
> >>
> >> Looking forward to your feedback.
> >>
> >
> > Sorry, I was stuck in MINA release (2.0.7) and two other Apache
> releases...
> >
> > Now that 2.0.7 is out, I'm focusing on the site and documentation, but I
> > will definitively look at your code !
> >
> > Thanks for the polling and sorry for the delay !
> >
> >
> > --
> > Regards,
> > Cordialement,
> > Emmanuel Lécharny
> > www.iktek.com
> >
> >
>

Re: [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

Posted by Julien Vermillard <jv...@gmail.com>.
Hi,
I took a look at it but it miss tests.
do you have some tests to provide ?
Julien

On Tue, Oct 23, 2012 at 12:15 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 10/23/12 11:53 AM, Dhruv Chopra a écrit :
>
>  Hi Folks,
>>
>> Wanted to check if anyone has had a chance to play with the code we
>> submitted for this filter.
>> In case some information is incomplete, please let me know.
>>
>> Looking forward to your feedback.
>>
>
> Sorry, I was stuck in MINA release (2.0.7) and two other Apache releases...
>
> Now that 2.0.7 is out, I'm focusing on the site and documentation, but I
> will definitively look at your code !
>
> Thanks for the polling and sorry for the delay !
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 10/23/12 11:53 AM, Dhruv Chopra a écrit :
> Hi Folks,
>
> Wanted to check if anyone has had a chance to play with the code we
> submitted for this filter.
> In case some information is incomplete, please let me know.
>
> Looking forward to your feedback.

Sorry, I was stuck in MINA release (2.0.7) and two other Apache releases...

Now that 2.0.7 is out, I'm focusing on the site and documentation, but I 
will definitively look at your code !

Thanks for the polling and sorry for the delay !


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

Posted by Ashish <pa...@gmail.com>.
Sure Dhruv!

Haven't had a chance to look at it. We shall look at it, at the
earliest possible and let you know :)

Thanks Again !
ashish

On Tue, Oct 23, 2012 at 3:23 PM, Dhruv Chopra
<dh...@shephertz.co.in> wrote:
> Hi Folks,
>
> Wanted to check if anyone has had a chance to play with the code we
> submitted for this filter.
> In case some information is incomplete, please let me know.
>
> Looking forward to your feedback.
> -Dhruv Chopra
>
>
> On Wed, Oct 17, 2012 at 12:45 AM, dhruv chopra (JIRA) <ji...@apache.org>wrote:
>
>>
>>     [
>> https://issues.apache.org/jira/browse/DIRMINA-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477267#comment-13477267]
>>
>> dhruv chopra commented on DIRMINA-907:
>> --------------------------------------
>>
>> The attached filter will abstract the client connection from the handler.
>> ie the handler will only decode/encode if the remote client is a websocket
>> (which it knows depending on if a websocket handshake has been performed or
>> not).
>>
>> > 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: 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
>>



-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers

Posted by Dhruv Chopra <dh...@shephertz.co.in>.
Hi Folks,

Wanted to check if anyone has had a chance to play with the code we
submitted for this filter.
In case some information is incomplete, please let me know.

Looking forward to your feedback.
-Dhruv Chopra


On Wed, Oct 17, 2012 at 12:45 AM, dhruv chopra (JIRA) <ji...@apache.org>wrote:

>
>     [
> https://issues.apache.org/jira/browse/DIRMINA-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477267#comment-13477267]
>
> dhruv chopra commented on DIRMINA-907:
> --------------------------------------
>
> The attached filter will abstract the client connection from the handler.
> ie the handler will only decode/encode if the remote client is a websocket
> (which it knows depending on if a websocket handshake has been performed or
> not).
>
> > 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: 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
>