Examples of ServerConnector


Examples of org.eclipse.jetty.server.ServerConnector

    @Override
    protected ServerConnector buildConnector( Server server, HttpConfiguration httpConfig )
    {
        SslConnectionFactory sslConnFactory = new SslConnectionFactory();
        configureSsl( sslConnFactory, configuration.get() );
        return new ServerConnector( server, sslConnFactory, new HttpConnectionFactory( httpConfig ) );
    }
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

    }

    public void start() throws Exception
    {
        jetty = new Server();
        ServerConnector connector = new ServerConnector(jetty );
        connector.setIdleTimeout( 1000 * 60 * 60 );
        connector.setSoLingerTime( -1 );
        connector.setPort( 8082 );
        jetty.setConnectors( new Connector[]{connector} );

        WebAppContext webAppContext = new WebAppContext();
        webAppContext.setContextPath( "/" );
        webAppContext.setWar( "src/main/webapp" );
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        HttpConfiguration httpConfig = new HttpConfiguration();
        configureHttp( httpConfig, configuration() );
        httpConfig = specializeHttp( httpConfig );

        // Set up connector
        ServerConnector connector = buildConnector( server, httpConfig );
        configureConnector( connector, configuration() );

        // Bind Connector to Server
        server.addConnector( connector );
        if( mBeanServer != null )
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        return httpConfig;
    }

    protected ServerConnector buildConnector( Server server, HttpConfiguration httpConfig )
    {
        return new ServerConnector( server, new HttpConnectionFactory( httpConfig ) );
    }
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        docRoot.deleteOnExit();

        System.setProperty("org.eclipse.jetty.util.log.DEBUG","");
        _server = new Server();

        ServerConnector connector = new ServerConnector(_server);
        connector.setPort(0);
        _server.setConnectors(new Connector[] {connector});
       
        _handler = new TestHandler();
        _server.setHandler(_handler);

        MBeanContainer.resetUnique();
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        _mBeanContainer = new MBeanContainer(mBeanServer);
        _server.addBean(_mBeanContainer,true);
        _server.addBean(Log.getLog());
       
        _counter = _handler.getRequestCounter();
        _server.addBean(_counter);

        _server.start();

        startClient();

        _monitor = new JMXMonitor();

        int port = connector.getLocalPort();
        _requestUrl = "http://localhost:"+port+ "/";
    }
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        // Configures connectors for this server instance.
        if (connectors != null)
        {
            for (Connector c:connectors)
            {
                ServerConnector jc = new ServerConnector(server);

                jc.setPort(c.getPort());
                jc.setIdleTimeout(c.getMaxIdleTime());

                server.addConnector(jc);
            }
        }
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

    }

    public void prepare(HttpServlet servlet) throws Exception
    {
        server = new Server();
        httpConnector = new ServerConnector(server);
        server.addConnector(httpConnector);

        fcgiConnector = new ServerConnector(server, new ServerFCGIConnectionFactory(new HttpConfiguration(), sendStatus200));
        server.addConnector(fcgiConnector);

        final String contextPath = "/";
        ServletContextHandler context = new ServletContextHandler(server, contextPath);
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        http_config.setSecurePort(8443);
        http_config.setSendXPoweredBy(true);
        http_config.setSendServerVersion(true);

        // HTTP connector
        ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));       
        http.setPort(8080);
        server.addConnector(http);
        // SSL Context Factory for HTTPS and SPDY
        String jetty_distro = System.getProperty("jetty.distro","../../jetty-distribution/target/distribution");
        SslContextFactory sslContextFactory = new SslContextFactory();
        sslContextFactory.setKeyStorePath(jetty_distro + "/etc/keystore");
        sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
        sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");

        // HTTPS Configuration
        HttpConfiguration https_config = new HttpConfiguration(http_config);
        https_config.addCustomizer(new SecureRequestCustomizer());
       
       
        // HTTP2 factory
        HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config);
       
        NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
        ALPNServerConnectionFactory alpn =
            new ALPNServerConnectionFactory(h2.getProtocol(),http.getDefaultProtocol());
        alpn.setDefaultProtocol(http.getDefaultProtocol());
       
        // SSL Factory
        SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,alpn.getProtocol());
       
        // HTTP2 Connector
        ServerConnector http2Connector =
            new ServerConnector(server,ssl,alpn,h2,new HttpConnectionFactory(https_config));
        http2Connector.setPort(8443);
        server.addConnector(http2Connector);
       
        ALPN.debug=true;
       
        server.start();
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

        configuration.setSendDateHeader(false);
        configuration.setSendServerVersion(false);
        String value = initParams.get("outputBufferSize");
        if (value != null)
            configuration.setOutputBufferSize(Integer.valueOf(value));
        proxyConnector = new ServerConnector(proxy, new HttpConnectionFactory(configuration));
        proxy.addConnector(proxyConnector);

        proxyContext = new ServletContextHandler(proxy, "/", true, false);
        ServletHolder proxyServletHolder = new ServletHolder(proxyServlet);
        proxyServletHolder.setInitParameters(initParams);
View Full Code Here

Examples of org.eclipse.jetty.server.ServerConnector

    }

    private void prepareServer(HttpServlet servlet) throws Exception
    {
        server = new Server();
        serverConnector = new ServerConnector(server);
        server.addConnector(serverConnector);

        ServletContextHandler appCtx = new ServletContextHandler(server, "/", true, false);
        ServletHolder appServletHolder = new ServletHolder(servlet);
        appCtx.addServlet(appServletHolder, "/*");
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.