@Override protected void initChannel(final SocketChannel socketChannel) throws Exception { final ChannelPipeline pipeline = socketChannel.pipeline(); if (sockjsConfig.isTls()) { final SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(false); pipeline.addLast(new SslHandler(engine)); } pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); final DefaultSimplePushServer simplePushServer = new DefaultSimplePushServer(datastore, simplePushConfig, privateKey); pipeline.addLast(new NotificationHandler(simplePushServer)); pipeline.addLast(new CorsInboundHandler()); pipeline.addLast(new SockJsHandler(new SimplePushServiceFactory(sockjsConfig, simplePushServer))); pipeline.addLast(backgroundGroup, new UserAgentReaperHandler(simplePushServer)); pipeline.addLast(new CorsOutboundHandler()); }
@Override protected void initChannel(final SocketChannel socketChannel) throws Exception { final ChannelPipeline pipeline = socketChannel.pipeline(); if (sockjsConfig.isTls()) { final SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(false); pipeline.addLast(new SslHandler(engine)); } pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); final DefaultSimplePushServer simplePushServer = new DefaultSimplePushServer(datastore, simplePushConfig, privateKey); pipeline.addLast(new NotificationHandler(simplePushServer)); pipeline.addLast(new CorsInboundHandler()); pipeline.addLast(new SockJsHandler(new SimplePushServiceFactory(sockjsConfig, simplePushServer))); pipeline.addLast(backgroundGroup, new UserAgentReaperHandler(simplePushServer)); pipeline.addLast(new CorsOutboundHandler()); }