From 8920cd16b6903f4317fdcbeac96ef3cdf51ae2c3 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 29 Aug 2012 16:00:43 +0200 Subject: [PATCH] Jetty9 - Ported the HTTP SPDY Proxy code. --- .../eclipse/jetty/server/HttpConnection.java | 7 +- jetty-spdy/spdy-jetty-http-webapp/pom.xml | 20 +- .../src/main/config/etc/jetty-spdy-proxy.xml | 26 +- .../src/main/config/etc/jetty-spdy.xml | 24 +- .../http/AbstractHTTPSPDYServerConnector.java | 62 -- .../spdy/http/HTTPSPDYServerConnector.java | 13 +- .../spdy/proxy/HTTPSPDYProxyConnector.java | 38 +- .../eclipse/jetty/spdy/proxy/ProxyEngine.java | 5 +- .../ProxyHTTPAsyncConnectionFactory.java | 39 - .../proxy/ProxyHTTPConnectionFactory.java | 47 + .../proxy/ProxyHTTPSPDYAsyncConnection.java | 306 ------ .../spdy/proxy/ProxyHTTPSPDYConnection.java | 330 ++++++ .../jetty/spdy/proxy/SPDYProxyEngine.java | 959 +++++++++--------- .../jetty/spdy/proxy/ProxyHTTPSPDYTest.java | 784 ++++++++++++++ .../jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java | 731 ------------- 15 files changed, 1731 insertions(+), 1660 deletions(-) delete mode 100644 jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYServerConnector.java delete mode 100644 jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPAsyncConnectionFactory.java create mode 100644 jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPConnectionFactory.java delete mode 100644 jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYAsyncConnection.java create mode 100644 jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYConnection.java create mode 100644 jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYTest.java delete mode 100644 jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 2e60a79efcf..ac9736fa274 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -78,11 +78,16 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http _generator = new HttpGenerator(); // TODO: consider moving the generator to the transport, where it belongs _generator.setSendServerVersion(getServer().getSendServerVersion()); _channel = new HttpChannelOverHttp(connector, config, endPoint, this, new Input()); - _parser = new HttpParser(_channel,config.getRequestHeaderSize()); + _parser = new HttpParser(newRequestHandler(),config.getRequestHeaderSize()); LOG.debug("New HTTP Connection {}", this); } + protected HttpParser.RequestHandler newRequestHandler() + { + return _channel; + } + public Server getServer() { return _connector.getServer(); diff --git a/jetty-spdy/spdy-jetty-http-webapp/pom.xml b/jetty-spdy/spdy-jetty-http-webapp/pom.xml index 6616a1d786a..06e633fd341 100644 --- a/jetty-spdy/spdy-jetty-http-webapp/pom.xml +++ b/jetty-spdy/spdy-jetty-http-webapp/pom.xml @@ -29,16 +29,14 @@ - - diff --git a/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy-proxy.xml b/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy-proxy.xml index e2144ab7d36..de91a1ef9e2 100644 --- a/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy-proxy.xml +++ b/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy-proxy.xml @@ -21,9 +21,12 @@ + + + 9090 - - + + spdy/2 @@ -79,7 +82,12 @@ - + + + + + + 8080 @@ -87,12 +95,18 @@ - - + + + + + + + + + 8443 - diff --git a/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy.xml b/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy.xml index 0d847bcbd48..b0d0059939c 100644 --- a/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy.xml +++ b/jetty-spdy/spdy-jetty-http-webapp/src/main/config/etc/jetty-spdy.xml @@ -11,9 +11,7 @@ TLSv1 - - - - + - - -