内容简介:smart-http 是一款采用 Java 语言编写的 Http 服务器,有别于业界知名的 Web容器:Tomcat、Undertow,smart-http 并不支持 Servlet 规范,但对于 Http 服务器所需的各项能力,它都具备。 smart-http 天生就是异步...
smart-http 是一款采用 Java 语言编写的 Http 服务器,有别于业界知名的 Web容器:Tomcat、Undertow,smart-http 并不支持 Servlet 规范,但对于 Http 服务器所需的各项能力,它都具备。
smart-http 天生就是异步非阻塞的 I/O 模型,因为其通信内核采用了 smart-socket。所以无论是性能还是稳定性,都是非常出色的。
更新内容
- 新增对Cookie的支持,实现了 request cookie 解析和 response cookie 编码,该功能已应用于smart-servlet。
- 新增HttpUtils、DateUtil,提供公用的 http 请求参数解析和日期处理实现。
快速体验
- 在您的Maven工程中引入smart-http依赖。
<dependency> <groupId>org.smartboot.http</groupId> <artifactId>smart-http-server</artifactId> <version>1.0.19</version> </dependency> - 拷贝以下代码并启动。
public class SimpleSmartHttp { public static void main(String[] args) { HttpBootstrap bootstrap = new HttpBootstrap(); //http消息 bootstrap.pipeline().next(new HttpHandle() { public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.write("hello world".getBytes()); } }); //websocket消息 bootstrap.wsPipeline().next(new WebSocketHandle() { public void doHandle(WebSocketRequest request, WebSocketResponse response) throws IOException { response.sendTextMessage("hello world"); } }); bootstrap.setPort(8080).start(); } } - 浏览器访问:http://localhost:8080/ 或采用ws客户端请求ws://127.0.0.1:8080
更多文档请访问:https://smartboot.gitee.io/book/smart-http/
福利时刻:基于 smart-http 实现的 Servlet 容器,也可能是国内首款自研的 Servlet 容器:smart-servlet 现已开源。该项目我们将尝试邀请社区中的开发者来参与共建,感兴趣的朋友欢迎加入我们,一起做一件牛逼的事。
以上所述就是小编给大家介绍的《smart-http 1.0.19 发布,轻量级的国产 HTTP 服务器》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Ordering Disorder
Khoi Vinh / New Riders Press / 2010-12-03 / USD 29.99
The grid has long been an invaluable tool for creating order out of chaos for designers of all kinds—from city planners to architects to typesetters and graphic artists. In recent years, web designers......一起来看看 《Ordering Disorder》 这本书的介绍吧!