Search in sources :

Example 1 with PortRange

use of org.glassfish.grizzly.PortRange in project dukescript-presenters by dukescript.

the class DynamicHTTP method initServer.

static URI initServer() throws Exception {
    server = HttpServer.createSimpleServer(null, new PortRange(8080, 65535));
    final WebSocketAddOn addon = new WebSocketAddOn();
    for (NetworkListener listener : server.getListeners()) {
        listener.registerAddOn(addon);
    }
    resources = new ArrayList<Resource>();
    conf = server.getServerConfiguration();
    final DynamicHTTP dh = new DynamicHTTP();
    conf.addHttpHandler(dh, "/");
    server.start();
    return pageURL("http", server, "/test.html");
}
Also used : PortRange(org.glassfish.grizzly.PortRange) WebSocketAddOn(org.glassfish.grizzly.websockets.WebSocketAddOn) NetworkListener(org.glassfish.grizzly.http.server.NetworkListener)

Example 2 with PortRange

use of org.glassfish.grizzly.PortRange in project dukescript-presenters by dukescript.

the class DynamicHTTP method initServer.

static URI initServer() throws Exception {
    server = HttpServer.createSimpleServer(null, new PortRange(8080, 65535));
    final WebSocketAddOn addon = new WebSocketAddOn();
    for (NetworkListener listener : server.getListeners()) {
        listener.registerAddOn(addon);
    }
    resources = new ArrayList<Resource>();
    conf = server.getServerConfiguration();
    final DynamicHTTP dh = new DynamicHTTP();
    conf.addHttpHandler(dh, "/");
    server.start();
    return pageURL("http", server, "/test.html");
}
Also used : PortRange(org.glassfish.grizzly.PortRange) WebSocketAddOn(org.glassfish.grizzly.websockets.WebSocketAddOn) NetworkListener(org.glassfish.grizzly.http.server.NetworkListener)

Example 3 with PortRange

use of org.glassfish.grizzly.PortRange in project dukescript-presenters by dukescript.

the class Browser method server.

private static HttpServer server(RootPage r) {
    int from = 8080;
    int to = 65535;
    // NOI18N
    String port = System.getProperty("com.dukescript.presenters.browserPort");
    if (port != null) {
        from = to = Integer.parseInt(port);
    }
    HttpServer s = HttpServer.createSimpleServer(null, new PortRange(from, to));
    final ServerConfiguration conf = s.getServerConfiguration();
    conf.addHttpHandler(r, "/");
    return s;
}
Also used : PortRange(org.glassfish.grizzly.PortRange) ServerConfiguration(org.glassfish.grizzly.http.server.ServerConfiguration) HttpServer(org.glassfish.grizzly.http.server.HttpServer)

Aggregations

PortRange (org.glassfish.grizzly.PortRange)3 NetworkListener (org.glassfish.grizzly.http.server.NetworkListener)2 WebSocketAddOn (org.glassfish.grizzly.websockets.WebSocketAddOn)2 HttpServer (org.glassfish.grizzly.http.server.HttpServer)1 ServerConfiguration (org.glassfish.grizzly.http.server.ServerConfiguration)1