View Javadoc

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