@Override public void start() throws Exception { this.jettyServer.start(); this.contextHandler.start(); Connector[] connectors = jettyServer.getConnectors(); NetworkConnector connector = (NetworkConnector) connectors[0]; this.port = connector.getLocalPort(); }
host=connector.getHost(); port=connector.getLocalPort(); if (port < 0) port = connector.getPort();
String protocol = connector.getDefaultConnectionFactory().getProtocol(); String scheme="http"; if (protocol.startsWith("SSL-") || protocol.equals("SSL")) scheme = "https"; String host=connector.getHost(); if (context!=null && context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) host=context.getVirtualHosts()[0]; if (path==null) path="/"; return new URI(scheme,null,host,connector.getLocalPort(),path,null,null);
public InetSocketAddress[] getAddresses() { InetSocketAddress[] addresses = new InetSocketAddress[ jetty.getConnectors().length ]; for( int i=0, n=addresses.length; i<n; i++ ) { NetworkConnector connector = (NetworkConnector)jetty.getConnectors()[ i ]; String host = connector.getHost(); if( host == null ) { addresses[ i ] = new InetSocketAddress( connector.getLocalPort() ); } else { addresses[ i ] = new InetSocketAddress( host, connector.getLocalPort() ); } } return addresses; }
&& findBindException(ex) != null) { throw new PortInUseException( ((NetworkConnector) connector).getPort());
NetworkConnector networkConnector = (NetworkConnector) connector; if (networkConnector != null) { for (ConnectionFactory x : networkConnector.getConnectionFactories()) { if (x instanceof HttpConnectionFactory) { ((HttpConnectionFactory) x).getHttpConfiguration().setSendServerVersion(config.isGatewayServerHeaderEnabled()); if (networkConnector.getName() == null) { log.startedGateway(networkConnector.getLocalPort()); } else { log.startedGateway(networkConnector.getName(), networkConnector.getLocalPort());
String scheme=connector.getDefaultConnectionFactory().getProtocol().startsWith("SSL-")?"https":"http"; String host=connector.getHost(); if (context!=null && context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) host=context.getVirtualHosts()[0]; if (path==null) path="/"; return new URI(scheme,null,host,connector.getLocalPort(),path,null,null);
public InetSocketAddress[] getAddresses() { InetSocketAddress[] addresses = new InetSocketAddress[ jetty.getConnectors().length ]; for( int i=0, n=addresses.length; i<n; i++ ) { NetworkConnector connector = (NetworkConnector)jetty.getConnectors()[ i ]; String host = connector.getHost(); if( host == null ) { addresses[ i ] = new InetSocketAddress( connector.getLocalPort() ); } else { addresses[ i ] = new InetSocketAddress( host, connector.getLocalPort() ); } } return addresses; }
int connPort = ((NetworkConnector)con).getPort();
.getConnectors()[i]; if (connector != null) { for(ConnectionFactory x : connector.getConnectionFactories()) { if(x instanceof HttpConnectionFactory) { ((HttpConnectionFactory)x).getHttpConfiguration().setSendServerVersion(config.isGatewayServerHeaderEnabled()); if (connector.getName() == null) { log.startedGateway(connector.getLocalPort()); } else { log.startedGateway(connector.getName(), connector.getLocalPort());
protected int getPort() { return ((NetworkConnector)server.getConnectors()[0]).getLocalPort(); }
host=connector.getHost(); port=connector.getLocalPort(); if (port < 0) port = connector.getPort();
String scheme=connector.getDefaultConnectionFactory().getProtocol().startsWith("SSL-")?"https":"http"; String host=connector.getHost(); if (context!=null && context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) host=context.getVirtualHosts()[0]; if (path==null) path="/"; return new URI(scheme,null,host,connector.getLocalPort(),path,null,null);
public InetSocketAddress[] getAddresses() { InetSocketAddress[] addresses = new InetSocketAddress[jetty.getConnectors().length]; for (int i = 0, n = addresses.length; i < n; i++) { NetworkConnector connector = (NetworkConnector) jetty.getConnectors()[i]; String host = connector.getHost(); if (host == null) { addresses[i] = new InetSocketAddress(connector.getLocalPort()); } else { addresses[i] = new InetSocketAddress(host, connector.getLocalPort()); } } return addresses; }
@SuppressWarnings("resource") private String getServerUrl() { NetworkConnector connector=null; for (Connector c: getServer().getConnectors()) { if (c instanceof NetworkConnector) { connector=(NetworkConnector)c; break; } } if (connector==null) return "http://localhost"; return "http://localhost:" + connector.getPort(); }
private static int http1Port() { return ((NetworkConnector) http1server.getConnectors()[0]).getLocalPort(); }
host=connector.getHost(); port=connector.getLocalPort(); if (port < 0) port = connector.getPort();