<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-16868</id>
	<title>Nabble - Apache MINA</title>
	<updated>2008-08-21T17:54:07Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/Apache-MINA-f16868.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Apache-MINA-f16868.html" />
	<subtitle type="html">Welcome to the &lt;a href=&quot;http://mina.apache.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Apache MINA&lt;/a&gt;&amp;nbsp;mailing list archive! Please read &lt;a href=&quot;http://mina.apache.org/contact.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;the community guideline&lt;/a&gt;&amp;nbsp;before your first post.</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-19099670</id>
	<title>Protected session</title>
	<published>2008-08-21T17:54:07Z</published>
	<updated>2008-08-21T17:54:07Z</updated>
	<author>
		<name>xavzeman</name>
	</author>
	<content type="html">I have been trying to find information on how to open a session protected by a login and password for 2 weeks. I have seen talks about IoSessionInitializer for mina 2.0, nothing for mina 1.1.7.
&lt;br&gt;&lt;br&gt;It is really amazing to me that a simple stuff like opening a connection based on login/password seem to be so darn difficult. All the gurus out there, when asked about this, don't even provide a clear cut example on how to do this.
&lt;br&gt;&lt;br&gt;The chat login example is useless too since the connection is establish with no restriction and that the login message is sent only after the session is opened.
&lt;br&gt;&lt;br&gt;I sound frustated simply because I am.
&lt;br&gt;&lt;br&gt;Can anybody guide all the users asking the same question to a clear answer?
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Commits-f16870.html&quot; embed=&quot;fixTarget[16870]&quot; target=&quot;_top&quot; &gt;Apache MINA Commits&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Protected-session-tp19099670p19099670.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19094228</id>
	<title>Re: Close connection is message is too large</title>
	<published>2008-08-21T11:22:07Z</published>
	<updated>2008-08-21T11:22:07Z</updated>
	<author>
		<name>Leandro Rodrigo Saad Cruz</name>
	</author>
	<content type="html">I noticed that exceptionCaught() method on my IoHandler just prints the
&lt;br&gt;error.
&lt;br&gt;Now I'm closing the connection on that method, but...
&lt;br&gt;&lt;br&gt;If I do somethings like this.
&lt;br&gt;session.write(SomeObject);
&lt;br&gt;session.close(true);
&lt;br&gt;&lt;br&gt;Sometimes I can read SomeObject on the client side. Sometimes I can't.
&lt;br&gt;How can I be sure that SomeObject can be read before the connection is
&lt;br&gt;closed?
&lt;br&gt;&lt;br&gt;:: Leandro
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Thu, Aug 21, 2008 at 2:49 PM, Leandro Rodrigo Saad Cruz &amp;lt;
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19094228&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;leandro.saad@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all. I'm trying to close the client connection if the message is too
&lt;br&gt;&amp;gt; large.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I wrote a simple test that tries to send some large amout of data to the
&lt;br&gt;&amp;gt; server, but the server seems to enter on a error loop. Throwing the same
&lt;br&gt;&amp;gt; exceptions, over and over.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; org.apache.mina.filter.codec.ProtocolDecoderException:
&lt;br&gt;&amp;gt; org.apache.mina.core.buffer.BufferDataException: dataLength: 1048826
&lt;br&gt;&amp;gt; (Hexdump: 00 10 00 FA AC ..... )
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:616)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:408)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:578)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:540)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:532)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:58)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.polling.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:857)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at java.lang.Thread.run(Thread.java:619)
&lt;br&gt;&amp;gt; Caused by: org.apache.mina.core.buffer.BufferDataException: dataLength:
&lt;br&gt;&amp;gt; 1048826
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.core.buffer.AbstractIoBuffer.prefixedDataAvailable(AbstractIoBuffer.java:1695)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:89)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:173)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:170)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ... 15 more
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Note: I'm using the ObjectSerializationCodecFactory
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any ideas?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Leandro Rodrigo Saad Cruz
&lt;br&gt;&amp;gt; software developer - certified scrum master
&lt;br&gt;&amp;gt; :: scrum.com.br
&lt;br&gt;&amp;gt; :: db.apache.org/ojb
&lt;br&gt;&amp;gt; :: guara-framework.sf.net
&lt;br&gt;&amp;gt; :: xingu.sf.net
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-User-Forum-f32104.html&quot; embed=&quot;fixTarget[32104]&quot; target=&quot;_top&quot; &gt;Apache MINA User Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Close-connection-is-message-is-too-large-tp19093690p19094228.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19093690</id>
	<title>Close connection is message is too large</title>
	<published>2008-08-21T10:49:34Z</published>
	<updated>2008-08-21T10:49:34Z</updated>
	<author>
		<name>Leandro Rodrigo Saad Cruz</name>
	</author>
	<content type="html">Hi all. I'm trying to close the client connection if the message is too
&lt;br&gt;large.
&lt;br&gt;&lt;br&gt;I wrote a simple test that tries to send some large amout of data to the
&lt;br&gt;server, but the server seems to enter on a error loop. Throwing the same
&lt;br&gt;exceptions, over and over.
&lt;br&gt;&lt;br&gt;org.apache.mina.filter.codec.ProtocolDecoderException:
&lt;br&gt;org.apache.mina.core.buffer.BufferDataException: dataLength: 1048826
&lt;br&gt;(Hexdump: 00 10 00 FA AC ..... )
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:616)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:408)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:578)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:540)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:532)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:58)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.polling.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:857)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at java.lang.Thread.run(Thread.java:619)
&lt;br&gt;Caused by: org.apache.mina.core.buffer.BufferDataException: dataLength:
&lt;br&gt;1048826
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.core.buffer.AbstractIoBuffer.prefixedDataAvailable(AbstractIoBuffer.java:1695)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:89)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:173)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:170)
&lt;br&gt;&amp;nbsp; &amp;nbsp; ... 15 more
&lt;br&gt;&lt;br&gt;Note: I'm using the ObjectSerializationCodecFactory
&lt;br&gt;&lt;br&gt;Any ideas?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Leandro Rodrigo Saad Cruz
&lt;br&gt;software developer - certified scrum master
&lt;br&gt;:: scrum.com.br
&lt;br&gt;:: db.apache.org/ojb
&lt;br&gt;:: guara-framework.sf.net
&lt;br&gt;:: xingu.sf.net
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-User-Forum-f32104.html&quot; embed=&quot;fixTarget[32104]&quot; target=&quot;_top&quot; &gt;Apache MINA User Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Close-connection-is-message-is-too-large-tp19093690p19093690.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19086441</id>
	<title>[jira] Closed: (DIRMINA-478) GzipFilter</title>
	<published>2008-08-21T03:58:44Z</published>
	<updated>2008-08-21T03:58:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/DIRMINA-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/DIRMINA-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Julien Vermillard closed DIRMINA-478.
&lt;br&gt;-------------------------------------
&lt;br&gt;&lt;br&gt;&lt;br&gt;closed, due to insightful mark &amp; edouard comments
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; GzipFilter
&lt;br&gt;&amp;gt; ----------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: DIRMINA-478
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/DIRMINA-478&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/DIRMINA-478&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: MINA
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: Filter
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 1.1.4
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Matthew Giedt
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Trivial
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fix For: 2.0.0-M4
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: gzip.zip.rename
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi Matt, 
&lt;br&gt;&amp;gt; On Nov 14, 2007 4:47 AM, mgiedt &amp;lt;mgiedt@...&amp;gt; wrote: 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I did some poking around and couldn't find a protocol handler for GZip so I 
&lt;br&gt;&amp;gt; &amp;gt; created this one. Would very much welcome the communities feedback; MINA 
&lt;br&gt;&amp;gt; &amp;gt; team the code is yours to do whatever you wish. (rename the file to 
&lt;br&gt;&amp;gt; &amp;gt; 'gzip.zip', bob's your uncle.) 
&lt;br&gt;&amp;gt; Thank you very much for your contribution first of all! :D 
&lt;br&gt;&amp;gt; However, would you mind if you can create a JIRA issue and attach that 
&lt;br&gt;&amp;gt; file there? &amp;nbsp;You have to grant license to the ASF for your work 
&lt;br&gt;&amp;gt; (gzip.zip) when you attach a file. &amp;nbsp;I know it's pain in the butt, but 
&lt;br&gt;&amp;gt; that's the way how legal stuff works. 
&lt;br&gt;&amp;gt; Thanks in advance and best regards, 
&lt;br&gt;&amp;gt; Trustin 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28DIRMINA-478%29-GzipFilter-tp13747885p19086441.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19083234</id>
	<title>Re: Executor thread no---signature</title>
	<published>2008-08-20T23:32:31Z</published>
	<updated>2008-08-20T23:32:31Z</updated>
	<author>
		<name>Steve Ulrich (proemion)</name>
	</author>
	<content type="html">Hi!
&lt;br&gt;&lt;br&gt;There's a thread pool, which means that there isn't a thread for each session. But the session's events are executed one-after-another, so you don't have to care about synchronzing as long as you stay in a session's context.
&lt;br&gt;&lt;br&gt;regards
&lt;br&gt;&lt;br&gt;Steve
&lt;br&gt;&lt;br&gt;&amp;gt; Alex _ [mailto:&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19083234&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;axs@...&lt;/a&gt;] wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi
&lt;br&gt;&amp;gt; how does the executor filterchain work? is each session in its own
&lt;br&gt;&amp;gt; thread or is each event within a session in its own thread? Or
&lt;br&gt;&amp;gt; something else? This is for mina 2M3
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Executor-thread-tp19081515p19083234.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19081870</id>
	<title>Re: Executor thread</title>
	<published>2008-08-20T20:22:11Z</published>
	<updated>2008-08-20T20:22:11Z</updated>
	<author>
		<name>Alex Karasulu</name>
	</author>
	<content type="html">On Wed, Aug 20, 2008 at 10:35 PM, Alex _ &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19081870&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;axs@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hi
&lt;br&gt;&amp;gt; how does the executor filterchain work? is each session in its own thread
&lt;br&gt;&amp;gt; or is each event within a session in its own thread? Or something else? This
&lt;br&gt;&amp;gt; is for mina 2M3
&lt;br&gt;&lt;br&gt;&lt;br&gt;Guess you're talking about ExecutorFilter - so yes each protocol message is
&lt;br&gt;delivered up to your handler its own thread taken from the executor's pool
&lt;br&gt;to free processor threads.
&lt;br&gt;&lt;br&gt;Alex
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Executor-thread-tp19081515p19081870.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19081515</id>
	<title>Executor thread</title>
	<published>2008-08-20T19:35:35Z</published>
	<updated>2008-08-20T19:35:35Z</updated>
	<author>
		<name>Alex _</name>
	</author>
	<content type="html">Hi
&lt;br&gt;how does the executor filterchain work? is each session in its own thread or is each event within a session in its own thread? Or something else? This is for mina 2M3&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Executor-thread-tp19081515p19081515.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19079365</id>
	<title>[jira] Resolved: (DIRMINA-478) GzipFilter</title>
	<published>2008-08-20T15:38:44Z</published>
	<updated>2008-08-20T15:38:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/DIRMINA-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/DIRMINA-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Edouard De Oliveira resolved DIRMINA-478.
&lt;br&gt;-----------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Resolution: Won't Fix
&lt;br&gt;&lt;br&gt;redundant with compression filter
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; GzipFilter
&lt;br&gt;&amp;gt; ----------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: DIRMINA-478
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/DIRMINA-478&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/DIRMINA-478&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: MINA
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: Filter
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 1.1.4
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Matthew Giedt
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Trivial
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fix For: 2.0.0-M4
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: gzip.zip.rename
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi Matt, 
&lt;br&gt;&amp;gt; On Nov 14, 2007 4:47 AM, mgiedt &amp;lt;mgiedt@...&amp;gt; wrote: 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I did some poking around and couldn't find a protocol handler for GZip so I 
&lt;br&gt;&amp;gt; &amp;gt; created this one. Would very much welcome the communities feedback; MINA 
&lt;br&gt;&amp;gt; &amp;gt; team the code is yours to do whatever you wish. (rename the file to 
&lt;br&gt;&amp;gt; &amp;gt; 'gzip.zip', bob's your uncle.) 
&lt;br&gt;&amp;gt; Thank you very much for your contribution first of all! :D 
&lt;br&gt;&amp;gt; However, would you mind if you can create a JIRA issue and attach that 
&lt;br&gt;&amp;gt; file there? &amp;nbsp;You have to grant license to the ASF for your work 
&lt;br&gt;&amp;gt; (gzip.zip) when you attach a file. &amp;nbsp;I know it's pain in the butt, but 
&lt;br&gt;&amp;gt; that's the way how legal stuff works. 
&lt;br&gt;&amp;gt; Thanks in advance and best regards, 
&lt;br&gt;&amp;gt; Trustin 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28DIRMINA-478%29-GzipFilter-tp13747885p19079365.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19069658</id>
	<title>Re: Weird bug: Closed iosession is being passed to decoder, only when using ExecutorFilter</title>
	<published>2008-08-20T06:38:16Z</published>
	<updated>2008-08-20T06:38:16Z</updated>
	<author>
		<name>Jigar Gosar-2</name>
	</author>
	<content type="html">Hey,
&lt;br&gt;&lt;br&gt;Even after adding my defensive code to my decoder, and using 
&lt;br&gt;ExecutorFilter I still find that only 16 threads are working on my 
&lt;br&gt;MyConnectionHandler. All thread named AnonymousIoService-1 thru 
&lt;br&gt;AnonymousIoService-16.
&lt;br&gt;&lt;br&gt;How can I increase the thread pool working on MyConnectionHandler?
&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks.
&lt;br&gt;&lt;br&gt;Jigar Gosar wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hey,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am new to mina, and using version 1.x
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is my code.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteBuffer.setUseDirectBuffers(false);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoAcceptor acceptor = new SocketAcceptor(4, 
&lt;br&gt;&amp;gt; Executors.newCachedThreadPool());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoServiceConfig acceptorConfig = acceptor.getDefaultConfig();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acceptorConfig.setThreadModel(ThreadModel.MANUAL);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocketAcceptorConfig cfg = new SocketAcceptorConfig();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acceptor.getFilterChain().addLast(&amp;quot;xml&amp;quot;, new 
&lt;br&gt;&amp;gt; ProtocolCodecFilter(new XMLCodecFactory()));
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acceptor.getFilterChain().addLast(&amp;quot;threadPool&amp;quot;, new 
&lt;br&gt;&amp;gt; ExecutorFilter(Executors.newCachedThreadPool()));
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acceptor.bind(new InetSocketAddress(PORT), new 
&lt;br&gt;&amp;gt; MyConnectionHandler(), cfg);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; While debugging I found that there are only 16 threads working on 
&lt;br&gt;&amp;gt; MyConnectionHandler. Hence I added Executor filter as suggested in the 
&lt;br&gt;&amp;gt; tutorial. The moment I started using Executor Filter, my xml 
&lt;br&gt;&amp;gt; CumulativeProtocolDecoder started blowing up.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; protected boolean doDecode(IoSession session, ByteBuffer in, 
&lt;br&gt;&amp;gt; ProtocolDecoderOutput out)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throws Exception {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Object parser = session.getAttribute(&amp;quot;parser&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// parser is now null, causing NPE's to be thrown, 
&lt;br&gt;&amp;gt; session.isConnected() == false
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am setting the parser parameter in my IoHandler's sessionOpened 
&lt;br&gt;&amp;gt; method. But why is closed session being passed to decoder? only when 
&lt;br&gt;&amp;gt; using executor filter.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Can some one explain how the default 16 threads for my IO handler and 
&lt;br&gt;&amp;gt; this Executor Filter work together, I am very confused.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Should I put code like following in my CumulativeProtocolDecoder
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; if(!session.isConnected()){
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&amp;quot;Why is doDecode called with closed 
&lt;br&gt;&amp;gt; session??&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;jigar gosar
&lt;br&gt;bottoms up, pun intended :)
&lt;br&gt;&lt;a href=&quot;http://jigar.org/blog&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jigar.org/blog&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://simplegtd.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://simplegtd.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://madcow.tumblr.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://madcow.tumblr.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://del.icio.us/cujigar&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://del.icio.us/cujigar&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-User-Forum-f32104.html&quot; embed=&quot;fixTarget[32104]&quot; target=&quot;_top&quot; &gt;Apache MINA User Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Weird-bug%3A-Closed-iosession-is-being-passed-to-decoder%2C-only-when-using-ExecutorFilter-tp19069437p19069658.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19069437</id>
	<title>Weird bug: Closed iosession is being passed to decoder, only when using ExecutorFilter</title>
	<published>2008-08-20T06:28:30Z</published>
	<updated>2008-08-20T06:28:30Z</updated>
	<author>
		<name>Jigar Gosar-2</name>
	</author>
	<content type="html">Hey,
&lt;br&gt;&lt;br&gt;I am new to mina, and using version 1.x
&lt;br&gt;&lt;br&gt;This is my code.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteBuffer.setUseDirectBuffers(false);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IoAcceptor acceptor = new SocketAcceptor(4, 
&lt;br&gt;Executors.newCachedThreadPool());
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IoServiceConfig acceptorConfig = acceptor.getDefaultConfig();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acceptorConfig.setThreadModel(ThreadModel.MANUAL);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SocketAcceptorConfig cfg = new SocketAcceptorConfig();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acceptor.getFilterChain().addLast(&amp;quot;xml&amp;quot;, new 
&lt;br&gt;ProtocolCodecFilter(new XMLCodecFactory()));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acceptor.getFilterChain().addLast(&amp;quot;threadPool&amp;quot;, new 
&lt;br&gt;ExecutorFilter(Executors.newCachedThreadPool()));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acceptor.bind(new InetSocketAddress(PORT), new 
&lt;br&gt;MyConnectionHandler(), cfg);
&lt;br&gt;&lt;br&gt;While debugging I found that there are only 16 threads working on 
&lt;br&gt;MyConnectionHandler. Hence I added Executor filter as suggested in the 
&lt;br&gt;tutorial. The moment I started using Executor Filter, my xml 
&lt;br&gt;CumulativeProtocolDecoder started blowing up.
&lt;br&gt;&lt;br&gt;&amp;nbsp;protected boolean doDecode(IoSession session, ByteBuffer in, 
&lt;br&gt;ProtocolDecoderOutput out)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throws Exception {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Object parser = session.getAttribute(&amp;quot;parser&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // parser is now null, causing NPE's to be thrown, 
&lt;br&gt;session.isConnected() == false
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ....
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;I am setting the parser parameter in my IoHandler's sessionOpened 
&lt;br&gt;method. But why is closed session being passed to decoder? only when 
&lt;br&gt;using executor filter.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Can some one explain how the default 16 threads for my IO handler and 
&lt;br&gt;this Executor Filter work together, I am very confused.
&lt;br&gt;&lt;br&gt;Should I put code like following in my CumulativeProtocolDecoder
&lt;br&gt;&lt;br&gt;&amp;nbsp;if(!session.isConnected()){
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Why is doDecode called with closed 
&lt;br&gt;session??&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-User-Forum-f32104.html&quot; embed=&quot;fixTarget[32104]&quot; target=&quot;_top&quot; &gt;Apache MINA User Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Weird-bug%3A-Closed-iosession-is-being-passed-to-decoder%2C-only-when-using-ExecutorFilter-tp19069437p19069437.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19066903</id>
	<title>[jira] Created: (FTPSERVER-167) Overridable method to plug-in a password encryption mechanism for authentication</title>
	<published>2008-08-20T03:44:47Z</published>
	<updated>2008-08-20T03:44:47Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">Overridable method to plug-in a password encryption mechanism for authentication
&lt;br&gt;--------------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Key: FTPSERVER-167
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/FTPSERVER-167&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/FTPSERVER-167&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: FtpServer
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Issue Type: New Feature
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Components: Core
&lt;br&gt;&amp;nbsp; &amp;nbsp; Affects Versions: 1.0-M3
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reporter: David Latorre
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: Minor
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fix For: 1.0-M3
&lt;br&gt;&lt;br&gt;&lt;br&gt;We need to use ftpserver against an existing database of users. The option to write custom SQL sentences works like a charm so our own difficulty is that passwords are encrypted in the database with a custom algorithm.
&lt;br&gt;&lt;br&gt;There are a couple of ways to do that already , but it would &amp;nbsp;be nice to have the possibility to provide our own password-processing method to the UserManager (so we don't have to create a custom UserManager).
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28FTPSERVER-167%29-Overridable-method-to-plug-in-a-password-encryption-mechanism-for-authentication-tp19066903p19066903.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19063855</id>
	<title>[jira] Closed: (FTPSERVER-166) 211.STAT - error in variable name</title>
	<published>2008-08-19T23:58:44Z</published>
	<updated>2008-08-19T23:58:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/FTPSERVER-166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/FTPSERVER-166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Niklas Gustavsson closed FTPSERVER-166.
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution: Fixed
&lt;br&gt;&amp;nbsp; &amp;nbsp; Fix Version/s: 1.0-M3
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assignee: Niklas Gustavsson
&lt;br&gt;&lt;br&gt;Updated message bundle files. Thanks for the report!
&lt;br&gt;&lt;br&gt;svn commit &amp;quot;/media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties&amp;quot; &amp;quot;/media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties&amp;quot; -m &amp;quot;Invalid placeholder name used in message bundle (FTPSERVER-166)&amp;quot; --username &amp;quot;ngn&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; M /media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; M /media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Transmitting file data: /media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Transmitting file data: /media/big/home/svn/apache/ftpserver-trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties
&lt;br&gt;Committed revision 687263
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 211.STAT - error in variable name
&lt;br&gt;&amp;gt; ---------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: FTPSERVER-166
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/FTPSERVER-166&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/FTPSERVER-166&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: FtpServer
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: Server
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 1.0-M2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: affects any, mine : Embedded, a variant of RHEL3.0, vm 1.5.0_04, hostpot
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Yves Le Borgne
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assignee: Niklas Gustavsson
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Minor
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fix For: 1.0-M3
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; the properties file in the resource bundle FtpStatus.properties 
&lt;br&gt;&amp;gt; for Reply 211.STAT , uses the variable &amp;quot;client.login&amp;quot; whilst the FtpReplyUtil
&lt;br&gt;&amp;gt; class looks for :
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public static final String CLIENT_LOGIN_NAME &amp;nbsp;= &amp;quot;client.login.name&amp;quot;;
&lt;br&gt;&amp;gt; my current workaround is to load a private properties file
&lt;br&gt;&amp;gt; with MessageResourceImpl to override the 211.STAT reply message
&lt;br&gt;&amp;gt; definition.
&lt;br&gt;&amp;gt; btw, great work - always a treat to adopt &amp;nbsp;such a good code-base.
&lt;br&gt;&amp;gt; -- yves
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Developer-Forum-f16869.html&quot; embed=&quot;fixTarget[16869]&quot; target=&quot;_top&quot; &gt;Apache MINA Developer Forum&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28FTPSERVER-166%29-211.STAT---error-in-variable-name-tp19050398p19063855.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19063835</id>
	<title>svn commit: r687263 - in /mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message: FtpStatus.properties FtpStatus_zh-tw.properties</title>
	<published>2008-08-19T23:55:48Z</published>
	<updated>2008-08-19T23:55:48Z</updated>
	<author>
		<name>ngn</name>
	</author>
	<content type="html">Author: ngn
&lt;br&gt;Date: Tue Aug 19 23:55:47 2008
&lt;br&gt;New Revision: 687263
&lt;br&gt;&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc?rev=687263&amp;view=rev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc?rev=687263&amp;view=rev&lt;/a&gt;&lt;br&gt;Log:
&lt;br&gt;Invalid placeholder name used in message bundle (FTPSERVER-166)
&lt;br&gt;&lt;br&gt;Modified:
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties
&lt;br&gt;&lt;br&gt;Modified: mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties?rev=687263&amp;r1=687262&amp;r2=687263&amp;view=diff&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties?rev=687263&amp;r1=687262&amp;r2=687263&amp;view=diff&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties (original)
&lt;br&gt;+++ mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties Tue Aug 19 23:55:47 2008
&lt;br&gt;@@ -231,7 +231,7 @@
&lt;br&gt;&amp;nbsp;550.SIZE.invalid={output.msg}\: Not a plain file.
&lt;br&gt;&amp;nbsp;213.SIZE={output.msg}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-211.STAT=Apache FtpServer\nConnected to {server.ip}\nConnected from {client.ip}\nLogged in as {client.login}\nEnd of status.
&lt;br&gt;+211.STAT=Apache FtpServer\nConnected to {server.ip}\nConnected from {client.ip}\nLogged in as {client.login.name}\nEnd of status.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;501.STOR=Syntax error in parameters or arguments.
&lt;br&gt;&amp;nbsp;550.STOR.invalid={output.msg}\: Invalid path.
&lt;br&gt;&lt;br&gt;Modified: mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties?rev=687263&amp;r1=687262&amp;r2=687263&amp;view=diff&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties?rev=687263&amp;r1=687262&amp;r2=687263&amp;view=diff&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties (original)
&lt;br&gt;+++ mina/ftpserver/trunk/core/src/main/resources/org/apache/ftpserver/message/FtpStatus_zh-tw.properties Tue Aug 19 23:55:47 2008
&lt;br&gt;@@ -181,7 +181,7 @@
&lt;br&gt;&amp;nbsp;550.SIZE.missing=\u8cc7\u6599\u593e\u300c{output.msg}\u300d\u7981\u6b62\u4f7f\u7528
&lt;br&gt;&amp;nbsp;550.SIZE.invalid=\u8cc7\u6599\u593e\u300c{output.msg}\u300d\u7981\u6b62\u4f7f\u7528
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-211.STAT=Apache FTP Server\n\u8207\u300c{server.ip}\u300d\u9023\u7d50\u4e2d\n\u5f9e\u300c{client.ip}\u300d\u9023\u7d50\u4e2d\n\u4ee5\u300c{client.login}\u300d\u767b\u9304\u9023\u7dda\n\u8cc7\u8a0a\u5b8c\u6210
&lt;br&gt;+211.STAT=Apache FTP Server\n\u8207\u300c{server.ip}\u300d\u9023\u7d50\u4e2d\n\u5f9e\u300c{client.ip}\u300d\u9023\u7d50\u4e2d\n\u4ee5\u300c{client.login.name}\u300d\u767b\u9304\u9023\u7dda\n\u8cc7\u8a0a\u5b8c\u6210
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;501.STOR=\u56e0\u5b50\u6216\u53c3\u6578\u69cb\u6210\u6709\u8aa4
&lt;br&gt;&amp;nbsp;550.STOR.permission=\u62d2\u7d55\u5b58\u53d6
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Commits-f16870.html&quot; embed=&quot;fixTarget[16870]&quot; target=&quot;_top&quot; &gt;Apache MINA Commits&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/svn-commit%3A-r687263---in--mina-ftpserver-trunk-core-src-main-resources-org-apache-ftpserver-message%3A-FtpStatus.properties-FtpStatus_zh-tw.properties-tp19063835p19063835.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19060945</id>
	<title>svn commit: r687202 - in /mina/trunk: core/src/main/java/org/apache/mina/proxy/utils/ core/src/test/java/org/apache/mina/proxy/ example/src/test/java/org/apache/mina/example/proxy/ example/src/test/java/org/apache/mina/example/proxy/telnet/</title>
	<published>2008-08-19T17:07:55Z</published>
	<updated>2008-08-19T17:07:55Z</updated>
	<author>
		<name>edeoliveira</name>
	</author>
	<content type="html">Author: edeoliveira
&lt;br&gt;Date: Tue Aug 19 17:07:55 2008
&lt;br&gt;New Revision: 687202
&lt;br&gt;&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc?rev=687202&amp;view=rev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc?rev=687202&amp;view=rev&lt;/a&gt;&lt;br&gt;Log:
&lt;br&gt;DIRMINA-415 proxy examples
&lt;br&gt;&lt;br&gt;Added:
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java &amp;nbsp; (with props)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java &amp;nbsp; (with props)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java &amp;nbsp; (with props)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java &amp;nbsp; (with props)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java &amp;nbsp; (with props)
&lt;br&gt;Modified:
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/main/java/org/apache/mina/proxy/utils/MD4.java &amp;nbsp; (props changed)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/main/java/org/apache/mina/proxy/utils/MD4Provider.java &amp;nbsp; (props changed)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/test/java/org/apache/mina/proxy/HttpAuthTest.java &amp;nbsp; (props changed)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/test/java/org/apache/mina/proxy/MD4Test.java &amp;nbsp; (props changed)
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java &amp;nbsp; (props changed)
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/core/src/main/java/org/apache/mina/proxy/utils/MD4.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:keywords = LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/core/src/main/java/org/apache/mina/proxy/utils/MD4Provider.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:keywords = LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/core/src/test/java/org/apache/mina/proxy/HttpAuthTest.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:keywords = LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/core/src/test/java/org/apache/mina/proxy/MD4Test.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:keywords = LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:keywords = LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
&lt;br&gt;&lt;br&gt;Added: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java?rev=687202&amp;view=auto&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java?rev=687202&amp;view=auto&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java (added)
&lt;br&gt;+++ mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java Tue Aug 19 17:07:55 2008
&lt;br&gt;@@ -0,0 +1,167 @@
&lt;br&gt;+/*
&lt;br&gt;+ * &amp;nbsp;Licensed to the Apache Software Foundation (ASF) under one
&lt;br&gt;+ * &amp;nbsp;or more contributor license agreements. &amp;nbsp;See the NOTICE file
&lt;br&gt;+ * &amp;nbsp;distributed with this work for additional information
&lt;br&gt;+ * &amp;nbsp;regarding copyright ownership. &amp;nbsp;The ASF licenses this file
&lt;br&gt;+ * &amp;nbsp;to you under the Apache License, Version 2.0 (the
&lt;br&gt;+ * &amp;nbsp;&amp;quot;License&amp;quot;); you may not use this file except in compliance
&lt;br&gt;+ * &amp;nbsp;with the License. &amp;nbsp;You may obtain a copy of the License at
&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/a&gt;&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp;Unless required by applicable law or agreed to in writing,
&lt;br&gt;+ * &amp;nbsp;software distributed under the License is distributed on an
&lt;br&gt;+ * &amp;nbsp;&amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&lt;br&gt;+ * &amp;nbsp;KIND, either express or implied. &amp;nbsp;See the License for the
&lt;br&gt;+ * &amp;nbsp;specific language governing permissions and limitations
&lt;br&gt;+ * &amp;nbsp;under the License.
&lt;br&gt;+ *
&lt;br&gt;+ */
&lt;br&gt;+package org.apache.mina.example.proxy;
&lt;br&gt;+
&lt;br&gt;+import java.io.File;
&lt;br&gt;+import java.io.FileOutputStream;
&lt;br&gt;+import java.io.IOException;
&lt;br&gt;+import java.nio.channels.FileChannel;
&lt;br&gt;+
&lt;br&gt;+import org.apache.mina.core.buffer.IoBuffer;
&lt;br&gt;+import org.apache.mina.core.session.IdleStatus;
&lt;br&gt;+import org.apache.mina.core.session.IoSession;
&lt;br&gt;+import org.apache.mina.proxy.AbstractProxyIoHandler;
&lt;br&gt;+import org.apache.mina.proxy.handlers.ProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyConstants;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.handlers.socks.SocksProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.session.ProxyIoSession;
&lt;br&gt;+import org.slf4j.Logger;
&lt;br&gt;+import org.slf4j.LoggerFactory;
&lt;br&gt;+
&lt;br&gt;+/**
&lt;br&gt;+ * ClientSessionHandler.java - Client session handler for the mina proxy test class.
&lt;br&gt;+ * 
&lt;br&gt;+ * @author The Apache MINA Project (&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19060945&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;)
&lt;br&gt;+ * @version $Rev$, $Date$
&lt;br&gt;+ * @since MINA 2.0.0-M3
&lt;br&gt;+ */
&lt;br&gt;+public class ClientSessionHandler extends AbstractProxyIoHandler {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private final static Logger logger = LoggerFactory
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getLogger(ClientSessionHandler.class);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The temporary file were the request result will be written.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private File file;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * NIO channel of the temporary file.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private FileChannel wChannel;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The command to issue to the proxy.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private String cmd;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public ClientSessionHandler(String cmd) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.cmd = cmd;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void sessionCreated(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session created: &amp;quot; + session);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Sends the request to the proxy server when session is opened with
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * the proxy. 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void proxySessionOpened(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session opened: &amp;quot; + session);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyIoSession proxyIoSession = (ProxyIoSession) session
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getAttribute(ProxyIoSession.PROXY_SESSION);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (proxyIoSession != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyRequest req = proxyIoSession.getRequest();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] c = null;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (req instanceof SocksProxyRequest &amp;&amp; cmd != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Sending request to a SOCKS SESSION ...&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c = cmd.getBytes(proxyIoSession.getCharsetName());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (req instanceof HttpProxyRequest
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;&amp; ((HttpProxyRequest) req).getHttpVerb() == HttpProxyConstants.CONNECT) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Sending request to a HTTP CONNECTED SESSION ...&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c = (((HttpProxyRequest) req).toHttpString())
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getBytes(proxyIoSession.getCharsetName());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (c != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoBuffer buf = IoBuffer.allocate(c.length);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;buf.put(c);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;buf.flip();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session.write(buf);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Writes the request result to a temporary file.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void messageReceived(IoSession session, Object message) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Message received: &amp;quot; + session);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoBuffer buf = (IoBuffer) message;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (file == null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;file = File.createTempFile(&amp;quot;http&amp;quot;, &amp;quot;.html&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.info(&amp;quot;Writing request result to &amp;quot;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ file.getAbsolutePath());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wChannel = new FileOutputStream(file, false).getChannel();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Write the ByteBuffer contents; the bytes between the ByteBuffer's
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// position and the limit is written to the file
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wChannel.write(buf.buf());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (IOException e) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Closes the temporary file if it was opened. 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void sessionClosed(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session closed - closing result file if open.&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Close the file
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (wChannel != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wChannel.close();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void sessionIdle(IoSession session, IdleStatus status)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (session.isClosing()) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session idle&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void exceptionCaught(IoSession session, Throwable cause) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Exception caught&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cause.printStackTrace();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session.close();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;\ No newline at end of file
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:eol-style = native
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ClientSessionHandler.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:mime-type = text/plain
&lt;br&gt;&lt;br&gt;Added: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java?rev=687202&amp;view=auto&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java?rev=687202&amp;view=auto&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java (added)
&lt;br&gt;+++ mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java Tue Aug 19 17:07:55 2008
&lt;br&gt;@@ -0,0 +1,231 @@
&lt;br&gt;+/*
&lt;br&gt;+ * &amp;nbsp;Licensed to the Apache Software Foundation (ASF) under one
&lt;br&gt;+ * &amp;nbsp;or more contributor license agreements. &amp;nbsp;See the NOTICE file
&lt;br&gt;+ * &amp;nbsp;distributed with this work for additional information
&lt;br&gt;+ * &amp;nbsp;regarding copyright ownership. &amp;nbsp;The ASF licenses this file
&lt;br&gt;+ * &amp;nbsp;to you under the Apache License, Version 2.0 (the
&lt;br&gt;+ * &amp;nbsp;&amp;quot;License&amp;quot;); you may not use this file except in compliance
&lt;br&gt;+ * &amp;nbsp;with the License. &amp;nbsp;You may obtain a copy of the License at
&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/a&gt;&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp;Unless required by applicable law or agreed to in writing,
&lt;br&gt;+ * &amp;nbsp;software distributed under the License is distributed on an
&lt;br&gt;+ * &amp;nbsp;&amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&lt;br&gt;+ * &amp;nbsp;KIND, either express or implied. &amp;nbsp;See the License for the
&lt;br&gt;+ * &amp;nbsp;specific language governing permissions and limitations
&lt;br&gt;+ * &amp;nbsp;under the License.
&lt;br&gt;+ *
&lt;br&gt;+ */
&lt;br&gt;+package org.apache.mina.example.proxy;
&lt;br&gt;+
&lt;br&gt;+import java.net.InetSocketAddress;
&lt;br&gt;+import java.net.URL;
&lt;br&gt;+import java.security.Security;
&lt;br&gt;+import java.util.ArrayList;
&lt;br&gt;+import java.util.HashMap;
&lt;br&gt;+import java.util.List;
&lt;br&gt;+
&lt;br&gt;+import org.apache.mina.core.RuntimeIoException;
&lt;br&gt;+import org.apache.mina.core.future.ConnectFuture;
&lt;br&gt;+import org.apache.mina.core.session.IdleStatus;
&lt;br&gt;+import org.apache.mina.core.session.IoSession;
&lt;br&gt;+import org.apache.mina.filter.logging.LoggingFilter;
&lt;br&gt;+import org.apache.mina.proxy.ProxyConnector;
&lt;br&gt;+import org.apache.mina.proxy.handlers.ProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpAuthenticationMethods;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyConstants;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.handlers.socks.SocksProxyConstants;
&lt;br&gt;+import org.apache.mina.proxy.handlers.socks.SocksProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.session.ProxyIoSession;
&lt;br&gt;+import org.apache.mina.proxy.utils.MD4Provider;
&lt;br&gt;+import org.apache.mina.transport.socket.nio.NioSocketConnector;
&lt;br&gt;+
&lt;br&gt;+/**
&lt;br&gt;+ * ProxyTestClient.java - Base test class for mina proxy
&lt;br&gt;+ * 
&lt;br&gt;+ * @author The Apache MINA Project (&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19060945&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;)
&lt;br&gt;+ * @version $Rev$, $Date$
&lt;br&gt;+ * @since MINA 2.0.0-M3
&lt;br&gt;+ */
&lt;br&gt;+public class ProxyTestClient {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The global variables used when creating the HTTP proxy connection.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The user login.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String USER = &amp;quot;TED_KODS&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The user password.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String PWD = &amp;quot;EDOUARD&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The domain name. (used in NTLM connections)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String DOMAIN = &amp;quot;MYDOMAIN&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The workstation name. (used in NTLM connections)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */ &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String WORKSTATION = &amp;quot;MYWORKSTATION&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Set this variable to true in order to generate HTTP/1.1 requests.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private final static boolean USE_HTTP_1_1 = false;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * NTLM proxy authentication needs a JCE provider that handles MD4 hashing.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;static {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Security.getProvider(&amp;quot;MINA&amp;quot;) == null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Security.addProvider(new MD4Provider());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Creates a connection to the endpoint through a proxy server using the specified
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * authentication method.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Command line arguments: 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; ProxyTestClient &amp;lt;proxy-hostname&amp;gt; &amp;lt;proxy-port&amp;gt; &amp;lt;url&amp;gt; &amp;lt;proxy-method&amp;gt; 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Note that &amp;lt;proxy-method&amp;gt; is OPTIONNAL a HTTP proxy connection will be used if not 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * specified.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Examples:
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyTestClient myproxy 8080 &lt;a href=&quot;http://mina.apache.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mina.apache.org&lt;/a&gt;&amp;nbsp;SOCKS4
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyTestClient squidsrv 3128 &lt;a href=&quot;http://mina.apache.org:80&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mina.apache.org:80&lt;/a&gt;&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @param args parse arguments to get proxy hostaname, proxy port, the url to connect to 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * and optionnaly the proxy authentication method 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @throws Exception
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public ProxyTestClient(String[] args) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (args.length &amp;lt; 3) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.println(ProxyTestClient.class.getName()
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ &amp;quot; &amp;lt;proxy-hostname&amp;gt; &amp;lt;proxy-port&amp;gt; &amp;lt;url&amp;gt; &amp;lt;proxy-method&amp;gt; (&amp;lt;proxy-method&amp;gt; is OPTIONNAL)&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create proxy connector.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NioSocketConnector socketConnector = new NioSocketConnector(Runtime
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getRuntime().availableProcessors() + 1);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyConnector connector = new ProxyConnector(socketConnector);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Set connect timeout.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.setConnectTimeoutMillis(5000);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL url = new URL(args[2]);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int port = url.getPort() == -1 ? url.getDefaultPort() : url.getPort();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyRequest req = null;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (args.length == 4) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (&amp;quot;SOCKS4&amp;quot;.equals(args[3])) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req = new SocksProxyRequest(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.SOCKS_VERSION_4,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.ESTABLISH_TCPIP_STREAM,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new InetSocketAddress(url.getHost(), port), USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (&amp;quot;SOCKS4a&amp;quot;.equals(args[3])) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req = new SocksProxyRequest(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.ESTABLISH_TCPIP_STREAM, url
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getHost(), port, USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (&amp;quot;SOCKS5&amp;quot;.equals(args[3])) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req = new SocksProxyRequest(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.SOCKS_VERSION_5,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.ESTABLISH_TCPIP_STREAM,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new InetSocketAddress(url.getHost(), port), USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((SocksProxyRequest) req).setPassword(PWD);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((SocksProxyRequest) req)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.setServiceKerberosName(Socks5GSSAPITestServer.SERVICE_NAME);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req = createHttpProxyRequest(args[2]);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req = createHttpProxyRequest(args[2]);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyIoSession proxyIoSession = new ProxyIoSession(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new InetSocketAddress(args[0], Integer.parseInt(args[1])), req);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Tests modifying authentication order preferences. First algorithm in list available on server 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// will be used for authentication.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List&amp;lt;HttpAuthenticationMethods&amp;gt; l = new ArrayList&amp;lt;HttpAuthenticationMethods&amp;gt;();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l.add(HttpAuthenticationMethods.DIGEST);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l.add(HttpAuthenticationMethods.BASIC);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proxyIoSession.setPreferedOrder(l);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.setProxyIoSession(proxyIoSession);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;socketConnector.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.getFilterChain().addLast(&amp;quot;logger&amp;quot;, new LoggingFilter());
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// This command is sent when using a socks proxy to request a page from the web server.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String cmd = &amp;quot;GET &amp;quot; + url.toExternalForm() + &amp;quot; HTTP/1.0&amp;quot;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ HttpProxyConstants.CRLF + HttpProxyConstants.CRLF;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.setHandler(new ClientSessionHandler(cmd));
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoSession session;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (;;) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ConnectFuture future = connector.connect();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;future.awaitUninterruptibly();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session = future.getSession();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (RuntimeIoException e) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println(&amp;quot;Failed to connect. Retrying in 5 secs ...&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.sleep(5000);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Wait until done
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (session != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session.getCloseFuture().awaitUninterruptibly();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.dispose();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.exit(0);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Creates a {@link HttpProxyRequest} from the provided &amp;lt;i&amp;gt;uri&amp;lt;/i&amp;gt; parameter.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * It uses the global variables defined at the top of the class to fill the 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * connection properties of the request. If the global variable &amp;lt;i&amp;gt;useHttp1_1&amp;lt;/i&amp;gt; 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * is set to true, it will create a HTTP/1.1 request.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @param uri the requested uri to connect to through the HTTP proxy
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @return the fully initialized {@link HttpProxyRequest} object
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private HttpProxyRequest createHttpProxyRequest(String uri) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;HttpProxyRequest req = new HttpProxyRequest(uri);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;HashMap&amp;lt;String, String&amp;gt; props = new HashMap&amp;lt;String, String&amp;gt;();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.USER_PROPERTY, USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.PWD_PROPERTY, PWD);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.DOMAIN_PROPERTY, DOMAIN);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.WORKSTATION_PROPERTY, WORKSTATION);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req.setProperties(props);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (USE_HTTP_1_1) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req.setHttpVersion(HttpProxyConstants.HTTP_1_1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return req;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public static void main(String[] args) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new ProxyTestClient(args);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;\ No newline at end of file
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:eol-style = native
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/ProxyTestClient.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:mime-type = text/plain
&lt;br&gt;&lt;br&gt;Added: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java?rev=687202&amp;view=auto&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java?rev=687202&amp;view=auto&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java (added)
&lt;br&gt;+++ mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java Tue Aug 19 17:07:55 2008
&lt;br&gt;@@ -0,0 +1,216 @@
&lt;br&gt;+/*
&lt;br&gt;+ * &amp;nbsp;Licensed to the Apache Software Foundation (ASF) under one
&lt;br&gt;+ * &amp;nbsp;or more contributor license agreements. &amp;nbsp;See the NOTICE file
&lt;br&gt;+ * &amp;nbsp;distributed with this work for additional information
&lt;br&gt;+ * &amp;nbsp;regarding copyright ownership. &amp;nbsp;The ASF licenses this file
&lt;br&gt;+ * &amp;nbsp;to you under the Apache License, Version 2.0 (the
&lt;br&gt;+ * &amp;nbsp;&amp;quot;License&amp;quot;); you may not use this file except in compliance
&lt;br&gt;+ * &amp;nbsp;with the License. &amp;nbsp;You may obtain a copy of the License at
&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/a&gt;&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp;Unless required by applicable law or agreed to in writing,
&lt;br&gt;+ * &amp;nbsp;software distributed under the License is distributed on an
&lt;br&gt;+ * &amp;nbsp;&amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&lt;br&gt;+ * &amp;nbsp;KIND, either express or implied. &amp;nbsp;See the License for the
&lt;br&gt;+ * &amp;nbsp;specific language governing permissions and limitations
&lt;br&gt;+ * &amp;nbsp;under the License.
&lt;br&gt;+ *
&lt;br&gt;+ */
&lt;br&gt;+package org.apache.mina.example.proxy;
&lt;br&gt;+
&lt;br&gt;+import java.io.DataInputStream;
&lt;br&gt;+import java.io.DataOutputStream;
&lt;br&gt;+import java.io.IOException;
&lt;br&gt;+import java.net.ServerSocket;
&lt;br&gt;+import java.net.Socket;
&lt;br&gt;+
&lt;br&gt;+import org.apache.mina.proxy.handlers.socks.SocksProxyConstants;
&lt;br&gt;+import org.apache.mina.proxy.utils.ByteUtilities;
&lt;br&gt;+import org.ietf.jgss.GSSContext;
&lt;br&gt;+import org.ietf.jgss.GSSCredential;
&lt;br&gt;+import org.ietf.jgss.GSSException;
&lt;br&gt;+import org.ietf.jgss.GSSManager;
&lt;br&gt;+import org.ietf.jgss.Oid;
&lt;br&gt;+import org.slf4j.Logger;
&lt;br&gt;+import org.slf4j.LoggerFactory;
&lt;br&gt;+
&lt;br&gt;+/**
&lt;br&gt;+ * Socks5GSSAPITestServer.java - Basic test server for SOCKS5 GSSAPI authentication.
&lt;br&gt;+ * 
&lt;br&gt;+ * NOTE: Launch this program with the following params in a pre-configured Kerberos V env.
&lt;br&gt;+ * Do not forget to replace &amp;lt; ... &amp;gt; vars with your own values.
&lt;br&gt;+ * 
&lt;br&gt;+ * -Djava.security.krb5.realm=&amp;lt;your_krb_realm&amp;gt; 
&lt;br&gt;+ * -Djavax.security.auth.useSubjectCredsOnly=false 
&lt;br&gt;+ * -Djava.security.krb5.kdc=&amp;lt;your_kdc_hostname&amp;gt;
&lt;br&gt;+ * -Djava.security.auth.login.config=${workspace_loc}\Mina2Proxy\src\bcsLogin.conf
&lt;br&gt;+ * -Dsun.security.krb5.debug=true 
&lt;br&gt;+ * 
&lt;br&gt;+ * @author The Apache MINA Project (&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19060945&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;)
&lt;br&gt;+ * @version $Rev$, $Date$
&lt;br&gt;+ * @since MINA 2.0.0-M3
&lt;br&gt;+ */
&lt;br&gt;+public class Socks5GSSAPITestServer {
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private final static Logger logger = LoggerFactory
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getLogger(Socks5GSSAPITestServer.class);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * NOTE : change this to comply with your Kerberos environment.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;protected final static String SERVICE_NAME = &amp;quot;host/myworkstation.local.network&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Selected mechanism message: advertises client to use SocksV5 protocol with
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * GSSAPI authentication.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static byte[] SELECT_GSSAPI_AUTH_MSG = new byte[] {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.SOCKS_VERSION_5,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.GSSAPI_AUTH };
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Simulates a Socks v5 server using only Kerberos V authentication.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @param localPort the local port used to bind the server
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @throws IOException
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @throws GSSException
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private static void doHandShake(int localPort) throws IOException,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSException {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServerSocket ss = new ServerSocket(localPort);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSManager manager = GSSManager.getInstance();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Create a GSSContext to receive the incoming request from the client. 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Use null for the server credentials passed in to tell the underlying 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * mechanism to use whatever credentials it has available that can be 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * used to accept this connection.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSCredential serverCreds = manager.createCredential(manager
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.createName(SERVICE_NAME, null),
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSCredential.DEFAULT_LIFETIME, new Oid(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.KERBEROS_V5_OID),
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSCredential.ACCEPT_ONLY);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (true) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Waiting for incoming connection on port {} ...&amp;quot;,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;localPort);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GSSContext context = manager.createContext(serverCreds);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Socket socket = ss.accept();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataInputStream inStream = new DataInputStream(socket
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getInputStream());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataOutputStream outStream = new DataOutputStream(socket
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getOutputStream());
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Got connection from client @ {}&amp;quot;, socket
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getInetAddress());
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Read SOCKS5 greeting packet
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte ver = (byte) inStream.read();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (ver != 0x05) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new IllegalStateException(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Wrong socks version received - &amp;quot; + ver);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte nbAuthMethods = (byte) inStream.read();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] methods = new byte[nbAuthMethods];
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;inStream.readFully(methods);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;boolean found = false;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (byte b : methods) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (b == SocksProxyConstants.GSSAPI_AUTH) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;found = true;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!found) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new IllegalStateException(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Client does not support GSSAPI authentication&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Send selected mechanism message
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.write(SELECT_GSSAPI_AUTH_MSG);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.flush();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Do the context establishment loop
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] token = null;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (!context.isEstablished()) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte authVersion = (byte) inStream.read();
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (authVersion != 0x01) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new IllegalStateException(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Wrong socks GSSAPI auth version received: &amp;quot;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ authVersion);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte mtyp = (byte) inStream.read();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mtyp != 0x01) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new IllegalArgumentException(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Message type should be equal to 1.&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int len = inStream.readShort();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;token = new byte[len];
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;inStream.readFully(token);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot; &amp;nbsp;Received Token[{}] = {}&amp;quot;, len,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteUtilities.asHex(token));
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;token = context.acceptSecContext(token, 0, token.length);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Send a token to the peer if one was generated by acceptSecContext
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (token != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;	Sending Token[{}] = {}&amp;quot;, token.length,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteUtilities.asHex(token));
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.writeByte(authVersion);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.writeByte(mtyp);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.writeShort(token.length);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.write(token);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outStream.flush();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Context Established !&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Client is {}&amp;quot;, context.getSrcName());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Server is {}&amp;quot;, context.getTargName());
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * If mutual authentication did not take place, then
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * only the client was authenticated to the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * server. Otherwise, both client and server were
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * authenticated to each other.	 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (context.getMutualAuthState()) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;Mutual authentication took place !&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// We can now abort the process after a short time as auth is OK
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// and finally block will close session 			 &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.sleep(500);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (Exception ex) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ex.printStackTrace();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} finally {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;context.dispose();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;socket.close();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public static void main(String[] args) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Obtain the command-line arguments and parse the port number
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (args.length != 1) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.println(&amp;quot;Usage: java &amp;lt;options&amp;gt; Socks5GSSAPITestServer &amp;lt;localPort&amp;gt;&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.exit(-1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;doHandShake(Integer.parseInt(args[0]));
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.exit(0);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;\ No newline at end of file
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:eol-style = native
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/Socks5GSSAPITestServer.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:mime-type = text/plain
&lt;br&gt;&lt;br&gt;Added: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java?rev=687202&amp;view=auto&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java?rev=687202&amp;view=auto&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java (added)
&lt;br&gt;+++ mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java Tue Aug 19 17:07:55 2008
&lt;br&gt;@@ -0,0 +1,136 @@
&lt;br&gt;+/*
&lt;br&gt;+ * &amp;nbsp;Licensed to the Apache Software Foundation (ASF) under one
&lt;br&gt;+ * &amp;nbsp;or more contributor license agreements. &amp;nbsp;See the NOTICE file
&lt;br&gt;+ * &amp;nbsp;distributed with this work for additional information
&lt;br&gt;+ * &amp;nbsp;regarding copyright ownership. &amp;nbsp;The ASF licenses this file
&lt;br&gt;+ * &amp;nbsp;to you under the Apache License, Version 2.0 (the
&lt;br&gt;+ * &amp;nbsp;&amp;quot;License&amp;quot;); you may not use this file except in compliance
&lt;br&gt;+ * &amp;nbsp;with the License. &amp;nbsp;You may obtain a copy of the License at
&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/a&gt;&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp;Unless required by applicable law or agreed to in writing,
&lt;br&gt;+ * &amp;nbsp;software distributed under the License is distributed on an
&lt;br&gt;+ * &amp;nbsp;&amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&lt;br&gt;+ * &amp;nbsp;KIND, either express or implied. &amp;nbsp;See the License for the
&lt;br&gt;+ * &amp;nbsp;specific language governing permissions and limitations
&lt;br&gt;+ * &amp;nbsp;under the License.
&lt;br&gt;+ *
&lt;br&gt;+ */
&lt;br&gt;+package org.apache.mina.example.proxy.telnet;
&lt;br&gt;+
&lt;br&gt;+import java.net.InetSocketAddress;
&lt;br&gt;+import java.nio.charset.Charset;
&lt;br&gt;+import java.util.HashMap;
&lt;br&gt;+
&lt;br&gt;+import org.apache.mina.core.RuntimeIoException;
&lt;br&gt;+import org.apache.mina.core.future.ConnectFuture;
&lt;br&gt;+import org.apache.mina.core.session.IoSession;
&lt;br&gt;+import org.apache.mina.filter.codec.ProtocolCodecFilter;
&lt;br&gt;+import org.apache.mina.filter.codec.textline.LineDelimiter;
&lt;br&gt;+import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
&lt;br&gt;+import org.apache.mina.proxy.ProxyConnector;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyConstants;
&lt;br&gt;+import org.apache.mina.proxy.handlers.http.HttpProxyRequest;
&lt;br&gt;+import org.apache.mina.proxy.session.ProxyIoSession;
&lt;br&gt;+import org.apache.mina.transport.socket.nio.NioSocketConnector;
&lt;br&gt;+
&lt;br&gt;+/**
&lt;br&gt;+ * ProxyTelnetTest.java - Tests a classical text communication through a proxy.
&lt;br&gt;+ * Changing the params and request type will allow to test the multiple options
&lt;br&gt;+ * (http or socks proxying, various authentications methods, ...).
&lt;br&gt;+ * 
&lt;br&gt;+ * @author The Apache MINA Project (&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19060945&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;)
&lt;br&gt;+ * @version $Rev$, $Date$
&lt;br&gt;+ * @since MINA 2.0.0-M3
&lt;br&gt;+ */
&lt;br&gt;+public class ProxyTelnetTest {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The user login used to authenticate with the proxy.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String USER = &amp;quot;TED_KODS&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The password used to authenticate with the proxy.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static String PWD = &amp;quot;EDOUARD&amp;quot;;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The address we really want to connect to.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static InetSocketAddress serverAddress = new InetSocketAddress(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;localhost&amp;quot;, 25);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * The address of the proxy server.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public final static InetSocketAddress proxyAddress = new InetSocketAddress(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;localhost&amp;quot;, 8080);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Connects to the endpoint running a text based protocol server through the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * proxy and allows user to type commands in the console to dialog with the
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * server.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * @throws Exception
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public ProxyTelnetTest() throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create proxy connector.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NioSocketConnector targetConnector = new NioSocketConnector(Runtime
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getRuntime().availableProcessors() + 1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyConnector connector = new ProxyConnector(targetConnector);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Example of socks v5 proxy use
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyRequest req = new SocksProxyRequest(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.SOCKS_VERSION_5,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SocksProxyConstants.ESTABLISH_TCPIP_STREAM, serverAddress, USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req.setPassword(PWD);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;HttpProxyRequest req = new HttpProxyRequest(serverAddress);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;HashMap&amp;lt;String, String&amp;gt; props = new HashMap&amp;lt;String, String&amp;gt;();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.USER_PROPERTY, USER);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;props.put(HttpProxyConstants.PWD_PROPERTY, PWD);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;req.setProperties(props); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProxyIoSession proxyIoSession = new ProxyIoSession(proxyAddress, req);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.setProxyIoSession(proxyIoSession);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LineDelimiter delim = new LineDelimiter(&amp;quot;\r\n&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;targetConnector.getFilterChain().addLast(
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;codec&amp;quot;,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new ProtocolCodecFilter(new TextLineCodecFactory(Charset
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.forName(&amp;quot;UTF-8&amp;quot;), delim, delim)));
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.setHandler(new TelnetSessionHandler());
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IoSession session;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (;;) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ConnectFuture future = connector.connect();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;future.awaitUninterruptibly();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session = future.getSession();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (RuntimeIoException e) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println(&amp;quot;Failed to connect. Retrying in 5 secs ...&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.sleep(5000);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Wait until done
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (session != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session.getCloseFuture().awaitUninterruptibly();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;connector.dispose();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.exit(0);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public static void main(String[] args) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new ProxyTelnetTest();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;\ No newline at end of file
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:eol-style = native
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/ProxyTelnetTest.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:mime-type = text/plain
&lt;br&gt;&lt;br&gt;Added: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java?rev=687202&amp;view=auto&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java?rev=687202&amp;view=auto&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java (added)
&lt;br&gt;+++ mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java Tue Aug 19 17:07:55 2008
&lt;br&gt;@@ -0,0 +1,110 @@
&lt;br&gt;+/*
&lt;br&gt;+ * &amp;nbsp;Licensed to the Apache Software Foundation (ASF) under one
&lt;br&gt;+ * &amp;nbsp;or more contributor license agreements. &amp;nbsp;See the NOTICE file
&lt;br&gt;+ * &amp;nbsp;distributed with this work for additional information
&lt;br&gt;+ * &amp;nbsp;regarding copyright ownership. &amp;nbsp;The ASF licenses this file
&lt;br&gt;+ * &amp;nbsp;to you under the Apache License, Version 2.0 (the
&lt;br&gt;+ * &amp;nbsp;&amp;quot;License&amp;quot;); you may not use this file except in compliance
&lt;br&gt;+ * &amp;nbsp;with the License. &amp;nbsp;You may obtain a copy of the License at
&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/a&gt;&lt;br&gt;+ *
&lt;br&gt;+ * &amp;nbsp;Unless required by applicable law or agreed to in writing,
&lt;br&gt;+ * &amp;nbsp;software distributed under the License is distributed on an
&lt;br&gt;+ * &amp;nbsp;&amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&lt;br&gt;+ * &amp;nbsp;KIND, either express or implied. &amp;nbsp;See the License for the
&lt;br&gt;+ * &amp;nbsp;specific language governing permissions and limitations
&lt;br&gt;+ * &amp;nbsp;under the License.
&lt;br&gt;+ *
&lt;br&gt;+ */
&lt;br&gt;+package org.apache.mina.example.proxy.telnet;
&lt;br&gt;+
&lt;br&gt;+import java.io.BufferedReader;
&lt;br&gt;+import java.io.InputStreamReader;
&lt;br&gt;+
&lt;br&gt;+import org.apache.mina.core.session.IoSession;
&lt;br&gt;+import org.apache.mina.proxy.AbstractProxyIoHandler;
&lt;br&gt;+import org.slf4j.Logger;
&lt;br&gt;+import org.slf4j.LoggerFactory;
&lt;br&gt;+
&lt;br&gt;+/**
&lt;br&gt;+ * TelnetSessionHandler.java - Telnet session handler.
&lt;br&gt;+ * 
&lt;br&gt;+ * @author The Apache MINA Project (&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19060945&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;)
&lt;br&gt;+ * @version $Rev$, $Date$
&lt;br&gt;+ * @since MINA 2.0.0-M3
&lt;br&gt;+ */
&lt;br&gt;+public class TelnetSessionHandler extends AbstractProxyIoHandler {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;private final static Logger logger = LoggerFactory
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getLogger(TelnetSessionHandler.class);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * Default constructor.
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public TelnetSessionHandler() {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void sessionCreated(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session created: &amp;quot; + session);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void proxySessionOpened(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session opened: &amp;quot; + session);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;final IoSession _session = session;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Enter typing loop
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new Thread(new Runnable() {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void run() {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStreamReader isr = new InputStreamReader(System.in);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BufferedReader br = new BufferedReader(isr);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (!_session.isClosing()) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String line = br.readLine();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (line != null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_session.write(line);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (Exception e) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_session.close();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}).start();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void messageReceived(IoSession session, Object message) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println((String) message);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void sessionClosed(IoSession session) throws Exception {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Session closed&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; * {@inheritDoc} 
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; */
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;@Override
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;public void exceptionCaught(IoSession session, Throwable cause) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.debug(&amp;quot;CLIENT - Exception caught&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cause.printStackTrace();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session.close();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;\ No newline at end of file
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:eol-style = native
&lt;br&gt;&lt;br&gt;Propchange: mina/trunk/example/src/test/java/org/apache/mina/example/proxy/telnet/TelnetSessionHandler.java
&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; svn:mime-type = text/plain
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Commits-f16870.html&quot; embed=&quot;fixTarget[16870]&quot; target=&quot;_top&quot; &gt;Apache MINA Commits&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/svn-commit%3A-r687202---in--mina-trunk%3A-core-src-main-java-org-apache-mina-proxy-utils--core-src-test-java-org-apache-mina-proxy--example-src-test-java-org-apache-mina-example-proxy--example-src-test-java-org-apache-mina-example-proxy-telnet--tp19060945p19060945.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19060886</id>
	<title>svn commit: r687201 - /mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java</title>
	<published>2008-08-19T16:59:59Z</published>
	<updated>2008-08-19T16:59:59Z</updated>
	<author>
		<name>edeoliveira</name>
	</author>
	<content type="html">Author: edeoliveira
&lt;br&gt;Date: Tue Aug 19 16:59:58 2008
&lt;br&gt;New Revision: 687201
&lt;br&gt;&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc?rev=687201&amp;view=rev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc?rev=687201&amp;view=rev&lt;/a&gt;&lt;br&gt;Log:
&lt;br&gt;Updated to use the new MD4 provider
&lt;br&gt;&lt;br&gt;Modified:
&lt;br&gt;&amp;nbsp; &amp;nbsp; mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java
&lt;br&gt;&lt;br&gt;Modified: mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java?rev=687201&amp;r1=687200&amp;r2=687201&amp;view=diff&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java?rev=687201&amp;r1=687200&amp;r2=687201&amp;view=diff&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java (original)
&lt;br&gt;+++ mina/trunk/core/src/test/java/org/apache/mina/proxy/NTLMTest.java Tue Aug 19 16:59:58 2008
&lt;br&gt;@@ -25,12 +25,14 @@
&lt;br&gt;&amp;nbsp;import java.io.UnsupportedEncodingException;
&lt;br&gt;&amp;nbsp;import java.security.MessageDigest;
&lt;br&gt;&amp;nbsp;import java.security.NoSuchAlgorithmException;
&lt;br&gt;+import java.security.Security;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;import junit.framework.TestCase;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;import org.apache.mina.proxy.handlers.http.ntlm.NTLMResponses;
&lt;br&gt;&amp;nbsp;import org.apache.mina.proxy.handlers.http.ntlm.NTLMUtilities;
&lt;br&gt;&amp;nbsp;import org.apache.mina.proxy.utils.ByteUtilities;
&lt;br&gt;+import org.apache.mina.proxy.utils.MD4Provider;
&lt;br&gt;&amp;nbsp;import org.slf4j.Logger;
&lt;br&gt;&amp;nbsp;import org.slf4j.LoggerFactory;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -45,6 +47,12 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;private final static Logger logger = LoggerFactory
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.getLogger(NTLMTest.class);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;static {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Security.getProvider(&amp;quot;MINA&amp;quot;) == null) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Security.addProvider(new MD4Provider());
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/**
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; * Tests bytes manipulations.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; */
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Apache-MINA-Commits-f16870.html&quot; embed=&quot;fixTarget[16870]&quot; target=&quot;_top&quot; &gt;Apache MINA Commits&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/svn-commit%3A-r687201----mina-trunk-core-src-test-java-org-apache-mina-proxy-NTLMTest.java-tp19060886p19060886.html" />
</entry>

<entry>
	<id>tag:www.nabble.co