1

From the tomcat 6 documentation it looks like you can set the classname of things like the Context (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), Engine (http://tomcat.apache.org/tomcat-6.0-doc/config/engine.html), and Host (http://tomcat.apache.org/tomcat-6.0-doc/config/host.html), but not the Connector.

Am I missing something here or is it just not possible?

2 Answers 2

3

The "protocol" attribute on the Connector element is really a class name. It's just that tomcat knows a few special values such as "HTTP/1.1" here to be a bit more friendly.

You could do

<Connector port="8080" protocol="com.example.MyConnector" > 
Sign up to request clarification or add additional context in comments.

1 Comment

Ha! Plain as day in the documentation but I guess I just breezed over protocol meaning anything other than the actual protocol. Thanks!
2

Yes, it is possible to implement your own connector (We have 2 custom impl. on your servers), you need to implement the protocol and all the jazz form there
for instance:

public class Http11NioInterceptor extends Http11NioProtocol {` public Http11NioInterceptor(){ super(); ep = new NioEndpointX(); //.... } //// } 

hope this helps

3 Comments

If I were contributing this to a standard tomcat install, how would I go about doing it? I can of course do this for an embedded install, but would I need to edit the server.xml in some way I'm not familiar?
@Zack, you have to put it in server.xml and set protocol to your impl. <Connector port="8080" address="xxx.yyy" maxThreads="100" maxHttpHeaderSize="8192" protocol="packname.xxx.Http11NioInterceptor"
This isn't really using a custom Connector but rather modifying the behavoir of the Connector by overwriting the Protocol that is used by the Connector. In tomcat 8.0 (maybe previous versions as well) createRequest() creates a catalina.Connector.Request. This behavior can't be modified by a custom Protocol.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.