Hello,

I am interested about this project for GSoC.

I've started writing a PoC for this. I want to ask you if I'm going in
the right direction.

It would be nice if the server could handle both standard XMPP clients
(5222) and xbosh (443 or 80). So MINA binds to 2 ports in TCPEndpoint
(for this I added an extra xbosh configurable port in TCPEndpoint).

The HTTP headers are decoded by XMLStreamTokenizer as XMLText
(XMLRawToFragmentConverter#convert).

So when receiving HTTP there would be 2 options:
1) To use the current XMLStreamTokenizer decoder and add a new <body/>
o.a.v.xmpp.Stanza  (ignoring the XMLText headers)
2) To have another decoder that decodes HTTP (having access to
headers) and then process the <body/>.
I know that xbosh says that we should ignore all the headers (except
maybe Accept-Encoding), but maybe there is some use for them.

Another option would be to parse the XMLText thrown in
XmppIoHandlerAdapter#messageReceivedNoStanza, but I incline to think
that this is not the right place.

I chose option 2) with the decoder option chosen like this:

public ProtocolDecoder getDecoder(IoSession s) throws Exception {
                if (((InetSocketAddress) s.getLocalAddress()).getPort() == 
xboshPort) {
                        return new XBoshDecoder(new XMLStreamTokenizer(new 
StanzaBuilderFactory()));
                } else {
                        return new XMLStreamTokenizer(new 
StanzaBuilderFactory());
                }
    }

And the XBoshDecoder uses the Apache AsyncWeb HTTP codec that does a
nice job at parsing HTTP.

Do you think this is overkill? I have some doubts, but I like that all
the HTTP information is available.

For SSL encryption I am thinking of putting the SSL filter by default
if the port 443 is configured for xbosh. To configure 2 IO filter
chains in MINA I don't know any other way but just to create a new
NioSocketAcceptor with a different chain.

I'll write more when I'll advance with the implementation.

Thanks,

Bogdan

On Tue, Mar 16, 2010 at 11:02 AM, Niklas Gustavsson
<[email protected]> wrote:
> On Tue, Mar 16, 2010 at 8:31 AM, Ashish <[email protected]> wrote:
>> Which project are we submitting?
>
> I've added the BOSH/WebSockets project:
> https://issues.apache.org/jira/browse/VYSPER-189
>
> /niklas
>

Reply via email to