Skip to content

Instantly share code, notes, and snippets.

@alexcheng1982
Last active December 12, 2017 16:54
Show Gist options
  • Save alexcheng1982/dbce2e943a8bcea41f0b7e6908ff90f2 to your computer and use it in GitHub Desktop.
Save alexcheng1982/dbce2e943a8bcea41f0b7e6908ff90f2 to your computer and use it in GitHub Desktop.
Jetty HttpConnector
final Server server = new Server();
final HttpConfiguration httpConfiguration = new HttpConfiguration();
httpConfiguration.setSecureScheme("https");
httpConfiguration.setSecurePort(httpsPort);
final ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(httpConfiguration));
http.setPort(httpPort);
server.addConnector(http);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment