Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] SPDY NPN without -Xbootclasspath


Hi,

Investigating SPDY support for JettyConsole (a Maven plugin embedding Jetty into runnable .war-files), I found a way to add SPDY support without setting -Xbootclasspath on the command line.

It involves attaching to the current JVM and then loading a JVM agent.

The agent adds a ClassFileTransformer. When the SSL classes in NPN-boot are loaded, the NPN-boot bytes are returned instead of the JVM's bytes.

Here's the complete implementation of the SPDY plugin for JettyConsole:

http://simplericity.org/svn/simplericity/trunk/jetty-console/jetty-console-plugins/jetty-console-spdy-plugin/

The loading of the agent happens in the bootstrap() method here:

http://simplericity.org/svn/simplericity/trunk/jetty-console/jetty-console-plugins/jetty-console-spdy-plugin/src/main/java/org/simplericity/jettyconsole/plugins/spdy/SpdyPlugin.java

And the JVM agent itself is here:

http://simplericity.org/svn/simplericity/trunk/jetty-console/jetty-console-plugins/jetty-console-spdy-plugin/src/main/java/org/simplericity/jettyconsole/plugins/spdy/SpdyAgent.java

It all seems to work, although I've only tested this on my Mac so far.

I think avoiding the bootclasspath hassle could help increase SPDY adoption. WDTY? Any interest in doing something similar in Jetty? 

Thanks,
Eirik. 

 

Back to the top