View Javadoc

1   //========================================================================
2   //Copyright 2011-2012 Mort Bay Consulting Pty. Ltd.
3   //------------------------------------------------------------------------
4   //All rights reserved. This program and the accompanying materials
5   //are made available under the terms of the Eclipse Public License v1.0
6   //and Apache License v2.0 which accompanies this distribution.
7   //The Eclipse Public License is available at
8   //http://www.eclipse.org/legal/epl-v10.html
9   //The Apache License v2.0 is available at
10  //http://www.opensource.org/licenses/apache2.0.php
11  //You may elect to redistribute this code under either of these licenses.
12  //========================================================================
13  
14  
15  package org.eclipse.jetty.spdy.proxy;
16  
17  import org.eclipse.jetty.spdy.ServerSPDYAsyncConnectionFactory;
18  import org.eclipse.jetty.spdy.api.SPDY;
19  import org.eclipse.jetty.spdy.http.AbstractHTTPSPDYServerConnector;
20  import org.eclipse.jetty.util.ssl.SslContextFactory;
21  
22  public class HTTPSPDYProxyConnector extends AbstractHTTPSPDYServerConnector
23  {
24      public HTTPSPDYProxyConnector(ProxyEngineSelector proxyEngineSelector)
25      {
26          this(proxyEngineSelector, null);
27      }
28  
29      public HTTPSPDYProxyConnector(ProxyEngineSelector proxyEngineSelector, SslContextFactory sslContextFactory)
30      {
31          super(proxyEngineSelector, sslContextFactory);
32          clearAsyncConnectionFactories();
33  
34          putAsyncConnectionFactory("spdy/3", new ServerSPDYAsyncConnectionFactory(SPDY.V3, getByteBufferPool(), getExecutor(), getScheduler(), proxyEngineSelector));
35          putAsyncConnectionFactory("spdy/2", new ServerSPDYAsyncConnectionFactory(SPDY.V2, getByteBufferPool(), getExecutor(), getScheduler(), proxyEngineSelector));
36          putAsyncConnectionFactory("http/1.1", new ProxyHTTPAsyncConnectionFactory(this, SPDY.V2, proxyEngineSelector));
37          setDefaultAsyncConnectionFactory(getAsyncConnectionFactory("http/1.1"));
38      }
39  }