All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.netty.example.http2.tiles.Launcher Maven / Gradle / Ivy

Go to download

This artifact provides a single jar that contains all classes required to use remote Jakarta Enterprise Beans and Jakarta Messaging, including all dependencies. It is intended for use by those not using maven, maven users should just import the Jakarta Enterprise Beans and Jakarta Messaging BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up with different versions on classes on the class path).

There is a newer version: 35.0.0.Final
Show newest version
/*
 * Copyright 2015 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.netty.example.http2.tiles;

import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;

/**
 * 

* Launches both Http and Http2 servers using Netty to display a set of images * and simulate latency. It is a Netty version of the Go lang HTTP2 tiles * demo. *

*

* Please note that if you intent to use the JDK provider for SSL, you MUST use JDK 1.8. * Previous JDK versions don't have any cipher suite that is suitable for use with HTTP/2. * The associated ALPN library for your JDK version can be found here: * http://eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions. * Alternatively, you can use the OpenSsl provider. Please make sure that you run OpenSsl * version 1.0.2 or greater. *

*/ public final class Launcher { public static void main(String[] args) { EventLoopGroup group = new NioEventLoopGroup(); Http2Server http2 = new Http2Server(group); HttpServer http = new HttpServer(group); try { http2.start(); System.err.println("Open your web browser and navigate to " + "http://" + Html.IP + ":" + HttpServer.PORT); http.start().sync(); } catch (Exception e) { e.printStackTrace(); } finally { group.shutdownGracefully(); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy