Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty 7 upgrade issue

Tony,

We are having a bit of a push on the doco front, so I'll make sure the
javadoc on the relevant bits is worked on in the next few weeks.

The way the connection replacement works in jetty-7 is that the
connect will first be given to a handler/filter/servlet.
It will be able to instantiate the new connection instance (complete
with any specializations or filters that you might want) and
then returns this to the container.

Any further IO is directed to the new connector instance.  Unlike the
tunnel, this is not a threadful thing.  It just get's called back
when there is IO to do.    You still need to manage the outgoing
connection, but you could do that NIO as well (eg the HttpClient).


cheers



Tony Thompson wrote:
> Greg,
> 
> I can potentially work on this because I need it.  I am in the middle of
> converting all of my other code at the moment so I want to get that work
> done first and will probably save this for last.  It could be a week or
> two before I start looking at it.
> 
> In case someone can tackle this before I can...
> 
> In Jetty 5, I have my own HttpTunnel class because I occasionally need
> to check some security things as data is moving through the tunnel and
> potentially disconnect the connection.  It would be nice if the
> ConnectConnection had something like a filter that I could register that
> would do my specific checks and indicate if the connection could be
> dropped.  That saves me the extra (duplicated) work of building my own
> tunnel to just add the small piece of code I need.
> 
> Also, the one thing that is bad about the way this works in Jetty 5 is
> the fact that I tie up a listener thread when a client is connected plus
> I have another thread going that copies data back to the client. 
> Obviously this doesn't scale so it would be nice (required?) if this was
> totally asynchronous.
> 
> Not to pile on about documentation but, since the javadocs are slim, it
> could take me a while to figure this out so I am all for a Jetty expert
> tackling it :)
> 
> Tony
> 
> Greg Wilkins wrote:
>> Tony,
>>
>> I've had a quick look and it should be pretty simple to
>> write.
>>
>> You need to create a ConnectConnection that is really just
>> a simplification of WebSocketConnection.  Instead of a
>> parser/generator it will just have the buffers and will
>> copy data through.
>>
>> You can set this up more or less the same as websocket,
>> but you need to send a 200 response first and then set
>> the response status to 101.
>>
>> The advantage of this approach is that it will be
>> asynchronous and will not need threads.... well you might
>> use 1 thread to handle the outbound connection, if you
>> don't want to do an async handler for that.
>>
>> Do you think you will have a go at implementing this?
>>
>> cheers
>>
>>
>>
>> Greg Wilkins wrote:
>>   
>>> Tony,
>>>
>>> it has gone, but it should not be hard to add back.
>>> In fact it can be modelled off the new websocket stuff,
>>> which replaces the HttpConnection with a WebSocketConnection.
>>>
>>> It should be pretty trivial to write a ConnectConnection.
>>> Hmmmm but we'll have to spoof the upgrade mechanism to
>>> trigger it....
>>>
>>> Let me think about this over the next day or two...
>>>
>>>
>>> cheers
>>>
>>>
>>>
>>> Tony Thompson wrote:
>>>     
>>>> I am afraid to ask because everything I have seen seems to indicate the
>>>> answer is "no" but, here goes....does Jetty 7 have support for HTTP
>>>> tunneling (CONNECT) from a handler?  With Jetty 5 I could set a tunnel
>>>> on the HTTP connection but it appears that is totally gone in Jetty 7. 
>>>> This ticket seems to indicate that support went away in Jetty 6 so I
>>>> hope enough time has passed that a better way has shown up in 7 and I
>>>> just can't find it:
>>>>
>>>> http://jira.codehaus.org/browse/JETTY-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>>>>
>>>> Thanks (I hope) for any info.
>>>> Tony
>>>>  
>>>> This message (and any associated files) is intended only for the
>>>> use of the individual or entity to which it is addressed and may
>>>> contain information that is confidential, subject to copyright or
>>>> constitutes a trade secret. If you are not the intended recipient
>>>> you are hereby notified that any dissemination, copying or
>>>> distribution of this message, or files associated with this message,
>>>> is strictly prohibited. If you have received this message in error,
>>>> please notify us immediately by replying to the message and deleting
>>>> it from your computer. Messages sent to and from Stoneware, Inc.
>>>> may be monitored.
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> jetty-users mailing list
>>>> jetty-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>>       
>>
>> _______________________________________________
>> jetty-users mailing list
>> jetty-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>   
>  
> This message (and any associated files) is intended only for the
> use of the individual or entity to which it is addressed and may
> contain information that is confidential, subject to copyright or
> constitutes a trade secret. If you are not the intended recipient
> you are hereby notified that any dissemination, copying or
> distribution of this message, or files associated with this message,
> is strictly prohibited. If you have received this message in error,
> please notify us immediately by replying to the message and deleting
> it from your computer. Messages sent to and from Stoneware, Inc.
> may be monitored.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top