Creates an ordinary, non-secured Jetty server jetty.

@param server Jetty server
@param host   host
@param port   port
@return - a server jetty
182032
public static ServerConnector createSocketConnector(Server server, String host, int port) {
        Assert.notNull(server, "'server' must not be null");
        Assert.notNull(host, "'host' must not be null");

        HttpConnectionFactory httpConnectionFactory = createHttpConnectionFactory();
        ServerConnector connector = new ServerConnector(server, httpConnectionFactory);
        initializeConnector(connector, host, port);
        return connector;
    }
1117614
@SuppressWarnings("deprecation")
	public static MailerRegularBuilderImpl withSMTPServer(@Nullable final String host, @Nullable final Integer port, @Nullable final String username, @Nullable final String password) {
		return new MailerRegularBuilderImpl().withSMTPServer(host, port, username, password);
	}
695657
public ServerSocketBar create(InetAddress host, int port)
    throws IOException, GeneralSecurityException
  {
    SSLServerSocketFactory ssFactory = null;
    
    if (_keyStore != null) {
      SSLContext sslContext = SSLContext.getInstance(_sslContext);

      KeyManagerFactory kmf
        = KeyManagerFactory.getInstance(keyManagerFactory());
    
      kmf.init(_keyStore, keyStorePassword().toCharArray());
      
      sslContext.init(kmf.getKeyManagers(), null, null);

      /*
      if (_cipherSuites != null)
        sslContext.createSSLEngine().setEnabledCipherSuites(_cipherSuites);

      if (_protocols != null)
        sslContext.createSSLEngine().setEnabledProtocols(_protocols);
      */
      
      SSLEngine engine = sslContext.createSSLEngine();
      
      engine.setEnabledProtocols(enabledProtocols(engine.getSupportedProtocols()));

      ssFactory = sslContext.getServerSocketFactory();
    }
    else {
      ssFactory = createAnonymousServerFactory(host, port);
    }
    
    ServerSocket serverSocket;

    int listen = 100;

    if (host == null)
      serverSocket = ssFactory.createServerSocket(port, listen);
    else
      serverSocket = ssFactory.createServerSocket(port, listen, host);

    SSLServerSocket sslServerSocket = (SSLServerSocket) serverSocket;
    
    if (_cipherSuites != null) {
      sslServerSocket.setEnabledCipherSuites(_cipherSuites);
    }
    
    if (_cipherSuitesForbidden != null) {
      String []cipherSuites = sslServerSocket.getEnabledCipherSuites();
      
      if (cipherSuites == null)
        cipherSuites = sslServerSocket.getSupportedCipherSuites();
      
      ArrayList<String> cipherList = new ArrayList<String>();
      
      for (String cipher : cipherSuites) {
        if (! isCipherForbidden(cipher, _cipherSuitesForbidden)) {
          cipherList.add(cipher);
        }
      }
      
      cipherSuites = new String[cipherList.size()];
      cipherList.toArray(cipherSuites);
      
      sslServerSocket.setEnabledCipherSuites(cipherSuites);
    }

    sslServerSocket.setEnabledProtocols(enabledProtocols(sslServerSocket.getSupportedProtocols()));
    
    if ("required".equals(_verifyClient))
      sslServerSocket.setNeedClientAuth(true);
    else if ("optional".equals(_verifyClient))
      sslServerSocket.setWantClientAuth(true);

    return new ServerSocketWrapper(serverSocket);
  }
612230
public static String toSocketAddressString(String host, int port) {
        String portStr = String.valueOf(port);
        return newSocketAddressStringBuilder(
                host, portStr, !isValidIpV6Address(host)).append(':').append(portStr).toString();
    }
53557
protected Server configureJetty(final int port) {
        final Server server = new Server();
        final ServerConnector connector = new ServerConnector(server);
        final ServletContextHandler sch = getServletContextHandler();

        // TODO: make all of this configurable
        connector.setIdleTimeout((int)TimeUnit.HOURS.toMillis(1));
        connector.setSoLingerTime(-1);
        connector.setPort(port);

        server.addConnector(connector);

        // set the injector as an attribute in the context
        sch.setAttribute("guice-injector", getInjector());

        // prevent the JSESSIONID from getting set via a URL argument
        sch.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none");

        // if we're using a database, then install the filter
        if(!settings.getDatabaseSettings().getNotUsed()) {
            // setup a FilterHolder for the Guice Persistence
            final FilterHolder persistFilter = new FilterHolder(getInjector().getInstance(PersistFilter.class));

            // add the filter to the context
            sch.addFilter(persistFilter, "/*", DISPATCHER_TYPES);
        }

        // configure a FilterHolder for Guice
        final FilterHolder filterHolder = new FilterHolder(GuiceFilter.class);

        sch.addFilter(filterHolder, "/*", DISPATCHER_TYPES);
        sch.addServlet(DefaultServlet.class, "/*");

        //server.setDumpAfterStart(true);
        server.setHandler(sch);


        return server;
    }
344294
protected void initServer(IJettyConfiguration iJettyConfiguration) throws JettyBootstrapException {
        if (server == null) {
            server = createServer(iJettyConfiguration);
            server.setConnectors(createConnectors(iJettyConfiguration, server));

            server.setHandler(handlers);

            if (iJettyConfiguration.isStopAtShutdown()) {
                createShutdownHook();
            }
        }
    }
1008132
public function devServer(string $host, int $port)
    {
        // Mark server mode
        define('SERVER_MODE', 'buildin');

        $this->config['host'] = $host;
        $this->config['port'] = $port;

        $this->printServerFinger();

        // Start cli Development Server
        $bind_http = $host . ':' . $port;
        passthru("php -S {$bind_http} -t " . APP_PATH . "/public");
    }
1121004
public static SafeCloseSmtpServer start(int port) {
		SafeCloseSmtpServer server = new SafeCloseSmtpServer(port);
		Thread t = new Thread(server, "Mock SMTP Server Thread");
		t.start();

		// Block until the server socket is created
		try {
			server.startupBarrier.await();
		} catch (InterruptedException e) {
			log.log(Level.WARNING, "Interrupted", e);
		}

		return server;
	}
960102
def create(host, port):
    
    wrapper = WrapperEchoServer({
        'server': None
    })
    d = {
        'listen_port': port,
        'changer': wrapper
    }
    if host:
        d['listen_bind_ip'] = host

    ses = EchoServer(d)
    wrapper.server = ses
    return [wrapper], cmd_line
1336741
public boolean isHostProxyable(String host) {
        return getProxyHost() != null
                && getProxyPort() > 0
                && (nonProxyPattern == null || !nonProxyPattern.matcher(host)
                        .matches());
    }
1340166
public static Cluster connectCluster(String host, int port) {
	Builder clusterBuilder = Cluster.builder();
	// Socket Options
	SocketOptions socketOptions = new SocketOptions();
	socketOptions.setConnectTimeoutMillis(60000);
	socketOptions.setKeepAlive(true);
	socketOptions.setReadTimeoutMillis(30000);
	return clusterBuilder.addContactPoint(host)
		.withSocketOptions(socketOptions).withPort(port).build();
    }
740044
public static JettyServerContract launchServerContract(int port, HttpObject... objects){
        JettyServerContract server = new JettyServerDelegate(new Server(port));
        server.setHandler(new HttpObjectsJettyHandler(Collections.singletonList(new GenericHeaderField("Cache-Control", "no-cache")), objects));
        server.start();
        return server;
    }
410227
public SSLEngine buildClientSSLEngine(String host, int port) {
        SSLEngine engine = sslContext.createSSLEngine(host, port);
        engine.setUseClientMode(true);
        return addCommonConfigs(engine);
    }
1060893
public synchronized Pair<PathHandler, Undertow> getServer(int port, String hostName) {
        return getServer(port,hostName,null);
    }
1039982
public static Socket createSocket(UrlParser urlParser, String host) throws IOException {
    return socketHandler.apply(urlParser, host);
  }
965709
public static InetSocketAddress createWithResolveRetry(
    String hostname,
    int port
  ) {
    return createWithResolveRetry(
      hostname,
      port,
      DEFAULT_DELAY_MILLIS,
      DEFAULT_MAX_ATTEMPTS
    );
  }
111781
public void setHttpProxy(String host, int port) {
        if (config == null) {
            config = new AipClientConfiguration();
        }
        this.config.setProxy(host, port, Proxy.Type.HTTP);
    }