392237 Fixed 3.0 port of chat servlet
This commit is contained in:
parent
71d7c6ff08
commit
18f7293efd
|
@ -22,12 +22,8 @@ import java.lang.management.ManagementFactory;
|
||||||
|
|
||||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||||
import org.eclipse.jetty.deploy.providers.WebAppProvider;
|
import org.eclipse.jetty.deploy.providers.WebAppProvider;
|
||||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
|
||||||
import org.eclipse.jetty.io.ByteBufferPool;
|
|
||||||
import org.eclipse.jetty.io.FilterConnection;
|
|
||||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||||
import org.eclipse.jetty.security.HashLoginService;
|
import org.eclipse.jetty.security.HashLoginService;
|
||||||
import org.eclipse.jetty.server.FilterConnectionFactory;
|
|
||||||
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
|
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
|
||||||
import org.eclipse.jetty.server.Handler;
|
import org.eclipse.jetty.server.Handler;
|
||||||
import org.eclipse.jetty.server.HttpChannelConfig;
|
import org.eclipse.jetty.server.HttpChannelConfig;
|
||||||
|
@ -49,7 +45,6 @@ import org.eclipse.jetty.spdy.server.http.PushStrategy;
|
||||||
import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
|
import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
|
||||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||||
import org.eclipse.jetty.util.thread.TimerScheduler;
|
|
||||||
|
|
||||||
public class SpdyServer
|
public class SpdyServer
|
||||||
{
|
{
|
||||||
|
@ -81,15 +76,13 @@ public class SpdyServer
|
||||||
|
|
||||||
// Http Connector
|
// Http Connector
|
||||||
HttpConnectionFactory http = new HttpConnectionFactory(config);
|
HttpConnectionFactory http = new HttpConnectionFactory(config);
|
||||||
FilterConnectionFactory filter = new FilterConnectionFactory(http.getProtocol());
|
ServerConnector httpConnector = new ServerConnector(server,http);
|
||||||
filter.addFilter(new FilterConnection.DumpToFileFilter("http-"));
|
|
||||||
ServerConnector httpConnector = new ServerConnector(server,filter,http);
|
|
||||||
httpConnector.setPort(8080);
|
httpConnector.setPort(8080);
|
||||||
httpConnector.setIdleTimeout(30000);
|
httpConnector.setIdleTimeout(10000);
|
||||||
|
|
||||||
server.addConnector(httpConnector);
|
server.addConnector(httpConnector);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// SSL configurations
|
// SSL configurations
|
||||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||||
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
||||||
|
@ -123,15 +116,10 @@ public class SpdyServer
|
||||||
NPNServerConnectionFactory npn = new NPNServerConnectionFactory(spdy3.getProtocol(),spdy2.getProtocol(),http.getProtocol());
|
NPNServerConnectionFactory npn = new NPNServerConnectionFactory(spdy3.getProtocol(),spdy2.getProtocol(),http.getProtocol());
|
||||||
npn.setDefaultProtocol(http.getProtocol());
|
npn.setDefaultProtocol(http.getProtocol());
|
||||||
npn.setInputBufferSize(1024);
|
npn.setInputBufferSize(1024);
|
||||||
|
|
||||||
FilterConnectionFactory npn_filter = new FilterConnectionFactory(npn.getProtocol());
|
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,npn.getProtocol());
|
||||||
npn_filter.addFilter(new FilterConnection.DumpToFileFilter("npn-"));
|
|
||||||
|
ServerConnector spdyConnector = new ServerConnector(server,ssl,npn,spdy3,spdy2,http);
|
||||||
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,npn_filter.getProtocol());
|
|
||||||
FilterConnectionFactory ssl_filter = new FilterConnectionFactory(ssl.getProtocol());
|
|
||||||
ssl_filter.addFilter(new FilterConnection.DumpToFileFilter("ssl-"));
|
|
||||||
|
|
||||||
ServerConnector spdyConnector = new ServerConnector(server,ssl_filter,ssl,npn_filter,npn,spdy3,spdy2,http);
|
|
||||||
spdyConnector.setPort(8443);
|
spdyConnector.setPort(8443);
|
||||||
|
|
||||||
server.addConnector(spdyConnector);
|
server.addConnector(spdyConnector);
|
||||||
|
|
|
@ -222,7 +222,7 @@ public abstract class AbstractEndPoint implements EndPoint
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return String.format("%s@%x{%s<r-l>%s,o=%b,is=%b,os=%b,fi=%s,wf=%s}{%s}",
|
return String.format("%s@%x{%s<r-l>%s,o=%b,is=%b,os=%b,fi=%s,wf=%s,to=%d}{%s}",
|
||||||
getClass().getSimpleName(),
|
getClass().getSimpleName(),
|
||||||
hashCode(),
|
hashCode(),
|
||||||
getRemoteAddress(),
|
getRemoteAddress(),
|
||||||
|
@ -232,6 +232,7 @@ public abstract class AbstractEndPoint implements EndPoint
|
||||||
isOutputShutdown(),
|
isOutputShutdown(),
|
||||||
_fillInterest,
|
_fillInterest,
|
||||||
_writeFlusher,
|
_writeFlusher,
|
||||||
|
_idleTimeout,
|
||||||
getConnection());
|
getConnection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,6 +372,14 @@ public class FilterConnection extends AbstractConnection
|
||||||
public FilteredEndPoint()
|
public FilteredEndPoint()
|
||||||
{
|
{
|
||||||
super(null,getEndPoint().getLocalAddress(), getEndPoint().getRemoteAddress());
|
super(null,getEndPoint().getLocalAddress(), getEndPoint().getRemoteAddress());
|
||||||
|
setIdleTimeout(getEndPoint().getIdleTimeout());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setIdleTimeout(long idleTimeout)
|
||||||
|
{
|
||||||
|
super.setIdleTimeout(idleTimeout);
|
||||||
|
getEndPoint().setIdleTimeout(idleTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -315,8 +315,8 @@ public class SslConnection extends AbstractConnection
|
||||||
|
|
||||||
public DecryptedEndPoint()
|
public DecryptedEndPoint()
|
||||||
{
|
{
|
||||||
// TODO does this need idle timeouts
|
|
||||||
super(null,getEndPoint().getLocalAddress(), getEndPoint().getRemoteAddress());
|
super(null,getEndPoint().getLocalAddress(), getEndPoint().getRemoteAddress());
|
||||||
|
setIdleTimeout(getEndPoint().getIdleTimeout());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -141,7 +141,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
|
||||||
private final ByteBufferPool _byteBufferPool;
|
private final ByteBufferPool _byteBufferPool;
|
||||||
private final Thread[] _acceptors;
|
private final Thread[] _acceptors;
|
||||||
private volatile CountDownLatch _stopping;
|
private volatile CountDownLatch _stopping;
|
||||||
private long _idleTimeout = 200000;
|
private long _idleTimeout = 30000;
|
||||||
private String _defaultProtocol;
|
private String _defaultProtocol;
|
||||||
private ConnectionFactory _defaultConnectionFactory;
|
private ConnectionFactory _defaultConnectionFactory;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ package org.eclipse.jetty.spdy.server.http;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.eclipse.jetty.http.HttpFields;
|
import org.eclipse.jetty.http.HttpFields;
|
||||||
|
@ -28,6 +30,7 @@ import org.eclipse.jetty.http.HttpGenerator;
|
||||||
import org.eclipse.jetty.http.HttpStatus;
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
import org.eclipse.jetty.http.HttpVersion;
|
import org.eclipse.jetty.http.HttpVersion;
|
||||||
import org.eclipse.jetty.io.EndPoint;
|
import org.eclipse.jetty.io.EndPoint;
|
||||||
|
import org.eclipse.jetty.io.RuntimeIOException;
|
||||||
import org.eclipse.jetty.server.Connector;
|
import org.eclipse.jetty.server.Connector;
|
||||||
import org.eclipse.jetty.server.HttpChannelConfig;
|
import org.eclipse.jetty.server.HttpChannelConfig;
|
||||||
import org.eclipse.jetty.server.HttpTransport;
|
import org.eclipse.jetty.server.HttpTransport;
|
||||||
|
@ -115,15 +118,27 @@ public class HttpTransportOverSPDY implements HttpTransport
|
||||||
sendToStream(content, lastContent);
|
sendToStream(content, lastContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendToStream(ByteBuffer content, boolean lastContent)
|
private void sendToStream(ByteBuffer content, boolean lastContent) throws IOException
|
||||||
{
|
{
|
||||||
|
Future<Void> future = stream.data(new ByteBufferDataInfo(content, lastContent));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
stream.data(new ByteBufferDataInfo(content, lastContent)).get();
|
if (endPoint.getIdleTimeout()>0)
|
||||||
|
future.get(endPoint.getIdleTimeout(),TimeUnit.MILLISECONDS);
|
||||||
|
else
|
||||||
|
future.get();
|
||||||
|
}
|
||||||
|
catch (ExecutionException e)
|
||||||
|
{
|
||||||
|
LOG.debug(e);
|
||||||
|
Throwable cause=e.getCause();
|
||||||
|
if (cause instanceof IOException)
|
||||||
|
throw (IOException)cause;
|
||||||
|
throw new RuntimeIOException(cause);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
endPoint.close();
|
throw new RuntimeIOException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,12 @@
|
||||||
<version>2.1</version>
|
<version>2.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||||
|
<artifactId>spdy-http-server</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>jstl</artifactId>
|
<artifactId>jstl</artifactId>
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ChatServlet extends HttpServlet
|
||||||
{
|
{
|
||||||
|
|
||||||
// inner class to hold message queue for each chat room member
|
// inner class to hold message queue for each chat room member
|
||||||
class Member
|
class Member implements AsyncListener
|
||||||
{
|
{
|
||||||
final String _name;
|
final String _name;
|
||||||
final AtomicReference<AsyncContext> _async=new AtomicReference<>();
|
final AtomicReference<AsyncContext> _async=new AtomicReference<>();
|
||||||
|
@ -54,6 +54,35 @@ public class ChatServlet extends HttpServlet
|
||||||
_name=name;
|
_name=name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTimeout(AsyncEvent event) throws IOException
|
||||||
|
{
|
||||||
|
AsyncContext async = _async.get();
|
||||||
|
if (async!=null && _async.compareAndSet(async,null))
|
||||||
|
{
|
||||||
|
HttpServletResponse response = (HttpServletResponse)async.getResponse();
|
||||||
|
response.setContentType("text/json;charset=utf-8");
|
||||||
|
PrintWriter out=response.getWriter();
|
||||||
|
out.print("{action:\"poll\"}");
|
||||||
|
async.complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartAsync(AsyncEvent event) throws IOException
|
||||||
|
{
|
||||||
|
event.getAsyncContext().addListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(AsyncEvent event) throws IOException
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete(AsyncEvent event) throws IOException
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,Map<String,Member>> _rooms = new HashMap<String,Map<String, Member>>();
|
Map<String,Map<String,Member>> _rooms = new HashMap<String,Map<String, Member>>();
|
||||||
|
@ -145,39 +174,10 @@ public class ChatServlet extends HttpServlet
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AsyncContext async = request.startAsync();
|
AsyncContext async = request.startAsync();
|
||||||
async.setTimeout(20000);
|
async.setTimeout(10000);
|
||||||
async.addListener(new AsyncListener()
|
async.addListener(member);
|
||||||
{
|
if (!member._async.compareAndSet(null,async))
|
||||||
@Override
|
throw new IllegalStateException();
|
||||||
public void onTimeout(AsyncEvent event) throws IOException
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStartAsync(AsyncEvent event) throws IOException
|
|
||||||
{
|
|
||||||
AsyncContext async = member._async.get();
|
|
||||||
if (member._async.compareAndSet(async,null))
|
|
||||||
{
|
|
||||||
HttpServletResponse response = (HttpServletResponse)async.getResponse();
|
|
||||||
response.setContentType("text/json;charset=utf-8");
|
|
||||||
PrintWriter out=response.getWriter();
|
|
||||||
out.print("{action:\"poll\"}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(AsyncEvent event) throws IOException
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete(AsyncEvent event) throws IOException
|
|
||||||
{
|
|
||||||
}
|
|
||||||
});
|
|
||||||
member._async.compareAndSet(null,async);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||||
import org.eclipse.jetty.security.HashLoginService;
|
import org.eclipse.jetty.security.HashLoginService;
|
||||||
|
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
|
||||||
import org.eclipse.jetty.server.Handler;
|
import org.eclipse.jetty.server.Handler;
|
||||||
|
import org.eclipse.jetty.server.HttpChannelConfig;
|
||||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||||
import org.eclipse.jetty.server.NCSARequestLog;
|
import org.eclipse.jetty.server.NCSARequestLog;
|
||||||
import org.eclipse.jetty.server.Request;
|
import org.eclipse.jetty.server.Request;
|
||||||
|
import org.eclipse.jetty.server.SecureRequestCustomizer;
|
||||||
import org.eclipse.jetty.server.ServerConnector;
|
import org.eclipse.jetty.server.ServerConnector;
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.eclipse.jetty.server.SslConnectionFactory;
|
import org.eclipse.jetty.server.SslConnectionFactory;
|
||||||
|
@ -42,6 +45,11 @@ import org.eclipse.jetty.server.handler.HandlerWrapper;
|
||||||
import org.eclipse.jetty.server.handler.RequestLogHandler;
|
import org.eclipse.jetty.server.handler.RequestLogHandler;
|
||||||
import org.eclipse.jetty.server.handler.ResourceHandler;
|
import org.eclipse.jetty.server.handler.ResourceHandler;
|
||||||
import org.eclipse.jetty.server.session.HashSessionManager;
|
import org.eclipse.jetty.server.session.HashSessionManager;
|
||||||
|
import org.eclipse.jetty.spdy.server.NPNServerConnectionFactory;
|
||||||
|
import org.eclipse.jetty.spdy.server.SPDYServerConnectionFactory;
|
||||||
|
import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory;
|
||||||
|
import org.eclipse.jetty.spdy.server.http.PushStrategy;
|
||||||
|
import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.util.log.StdErrLog;
|
import org.eclipse.jetty.util.log.StdErrLog;
|
||||||
|
@ -74,32 +82,60 @@ public class TestServer
|
||||||
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
||||||
server.addBean(mbContainer);
|
server.addBean(mbContainer);
|
||||||
server.addBean(Log.getLog());
|
server.addBean(Log.getLog());
|
||||||
|
|
||||||
|
|
||||||
// Setup Connectors
|
// Common HTTP configuration
|
||||||
ServerConnector connector0 = new ServerConnector(server);
|
HttpChannelConfig config = new HttpChannelConfig();
|
||||||
connector0.setPort(8080);
|
config.setSecurePort(8443);
|
||||||
connector0.setIdleTimeout(30000);
|
config.addCustomizer(new ForwardedRequestCustomizer());
|
||||||
connector0.getConnectionFactory(HttpConnectionFactory.class).getHttpChannelConfig().setSecurePort(8443);
|
config.addCustomizer(new SecureRequestCustomizer());
|
||||||
server.addConnector(connector0);
|
|
||||||
|
|
||||||
// Setup Connectors
|
// Http Connector
|
||||||
ServerConnector connector1 = new ServerConnector(server);
|
HttpConnectionFactory http = new HttpConnectionFactory(config);
|
||||||
connector1.setPort(8081);
|
ServerConnector httpConnector = new ServerConnector(server,http);
|
||||||
connector1.setIdleTimeout(30000);
|
httpConnector.setPort(8080);
|
||||||
connector1.getConnectionFactory(HttpConnectionFactory.class).getHttpChannelConfig().setSecurePort(8443);
|
httpConnector.setIdleTimeout(30000);
|
||||||
server.addConnector(connector1);
|
server.addConnector(httpConnector);
|
||||||
|
|
||||||
|
|
||||||
ServerConnector ssl_connector = new ServerConnector(server,new SslContextFactory());
|
|
||||||
ssl_connector.setPort(8443);
|
|
||||||
SslContextFactory cf = ssl_connector.getConnectionFactory(SslConnectionFactory.class).getSslContextFactory();
|
|
||||||
cf.setKeyStorePath(jetty_root + "/jetty-server/src/main/config/etc/keystore");
|
|
||||||
cf.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
|
||||||
cf.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
|
||||||
cf.setTrustStorePath(jetty_root + "/jetty-server/src/main/config/etc/keystore");
|
|
||||||
cf.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
|
||||||
server.addConnector(ssl_connector);
|
|
||||||
|
|
||||||
|
|
||||||
|
// SSL configurations
|
||||||
|
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||||
|
sslContextFactory.setKeyStorePath(jetty_root + "/jetty-server/src/main/config/etc/keystore");
|
||||||
|
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||||
|
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||||
|
sslContextFactory.setTrustStorePath(jetty_root + "/jetty-server/src/main/config/etc/keystore");
|
||||||
|
sslContextFactory.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||||
|
sslContextFactory.setExcludeCipherSuites(
|
||||||
|
"SSL_RSA_WITH_DES_CBC_SHA",
|
||||||
|
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
||||||
|
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||||
|
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||||
|
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||||
|
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||||
|
"SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
|
||||||
|
|
||||||
|
|
||||||
|
// Spdy Connector
|
||||||
|
SPDYServerConnectionFactory.checkNPNAvailable();
|
||||||
|
PushStrategy push = new ReferrerPushStrategy();
|
||||||
|
HTTPSPDYServerConnectionFactory spdy2 = new HTTPSPDYServerConnectionFactory(2,config,push);
|
||||||
|
spdy2.setInputBufferSize(8192);
|
||||||
|
spdy2.setInitialWindowSize(32768);
|
||||||
|
HTTPSPDYServerConnectionFactory spdy3 = new HTTPSPDYServerConnectionFactory(3,config,push);
|
||||||
|
spdy2.setInputBufferSize(8192);
|
||||||
|
NPNServerConnectionFactory npn = new NPNServerConnectionFactory(spdy3.getProtocol(),spdy2.getProtocol(),http.getProtocol());
|
||||||
|
npn.setDefaultProtocol(http.getProtocol());
|
||||||
|
npn.setInputBufferSize(1024);
|
||||||
|
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,npn.getProtocol());
|
||||||
|
ServerConnector spdyConnector = new ServerConnector(server,ssl,npn,spdy3,spdy2,http);
|
||||||
|
spdyConnector.setPort(8443);
|
||||||
|
spdyConnector.setIdleTimeout(30000);
|
||||||
|
server.addConnector(spdyConnector);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Handlers
|
||||||
HandlerCollection handlers = new HandlerCollection();
|
HandlerCollection handlers = new HandlerCollection();
|
||||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||||
RequestLogHandler requestLogHandler = new RequestLogHandler();
|
RequestLogHandler requestLogHandler = new RequestLogHandler();
|
||||||
|
|
Loading…
Reference in New Issue