1 Star 0 Fork 2

周周/vertx-examples

forked from githubsync/vertx-examples 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Server.java 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
package io.vertx.example.webclient.https;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.net.JksOptions;
import io.vertx.example.util.Runner;
/*
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
*/
public class Server extends AbstractVerticle {
// Convenience method so you can run it in your IDE
public static void main(String[] args) {
Runner.runExample(Server.class);
}
@Override
public void start() throws Exception {
// Start an SSL/TLS http server
vertx.createHttpServer(new HttpServerOptions().setKeyStoreOptions(new JksOptions()
.setPath("server-keystore.jks")
.setPassword("wibble"))
.setSsl(true)
).requestHandler(req -> {
req.response().end();
}).listen(8443, listenResult -> {
if (listenResult.failed()) {
System.out.println("Could not start HTTP server");
listenResult.cause().printStackTrace();
} else {
System.out.println("Server started");
}
});
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhouzq2046/vertx-examples.git
git@gitee.com:zhouzq2046/vertx-examples.git
zhouzq2046
vertx-examples
vertx-examples
4.x

搜索帮助