Make clear how to use HTTPS in the helloworld example

This commit is contained in:
Norman Maurer 2013-07-12 11:21:51 +02:00
parent 023201f684
commit 4e604a6553

View File

@ -25,6 +25,11 @@ public class HttpHelloWorldServerInitializer extends ChannelInitializer<SocketCh
public void initChannel(SocketChannel ch) throws Exception { public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline(); ChannelPipeline p = ch.pipeline();
// Uncomment the following line if you want HTTPS
//SSLEngine engine = SecureChatSslContextFactory.getServerContext().createSSLEngine();
//engine.setUseClientMode(false);
//p.addLast("ssl", new SslHandler(engine));
p.addLast("codec", new HttpServerCodec()); p.addLast("codec", new HttpServerCodec());
p.addLast("handler", new HttpHelloWorldServerHandler()); p.addLast("handler", new HttpHelloWorldServerHandler());
} }