您现在的位置是:首页 > 文章详情

国产开源 Http 服务器,smart-http 1.1.6 发布

日期:2021-06-20点击:926

smart-http 是一款基于 smart-socket 的可编程式 http 应用微内核,同时还是为数不多的专注于服务器领域的国产开源项目。

你可以将 smart-http 开发的程序部署在任何 Java 8 及以上版本的设备上。经过我们的不懈优化, 已经最大限度的降低程序运行期间对于内存和 GC 的开销。smart-http,是一款体现了作为开源人的工匠精神的作品。

开发示例

服务端

 public class SimpleSmartHttp { public static void main(String[] args) { HttpBootstrap bootstrap = new HttpBootstrap(); bootstrap.pipeline(new HttpServerHandler() { @Override public void handle(HttpRequest request, HttpResponse response) throws IOException { response.write("hello world<br/>".getBytes()); } }); bootstrap.setPort(8080).start(); } }

客户端 

 public class HttpGetDemo { public static void main(String[] args) { HttpClient httpClient = new HttpClient("www.baidu.com", 80); httpClient.connect(); httpClient.get("/") .onSuccess(response -> System.out.println(response.body())) .onFailure(Throwable::printStackTrace) .send(); } }

更新内容

  1. 升级 smart-socket 至 1.5.10。
  2. 清理无调用的代码。
  3. websocket 负载长度从 16384 扩容至 65535。
  4. Handle 接口重定义为 Handler,相关接口、类同步调整。
  5. 重构服务端 Http 解码类,支持传入配置项 HttpServerConfiguration。
  6. 重构 Http 编码接口。
  7. 补充单测。
  8. 移除 assembly  模块。

文档地址

GiteePages:https://smartboot.gitee.io/book/smart-http/

项目地址

Gitee:https://gitee.com/smartboot/smart-http

原文链接:https://www.oschina.net/news/146766/smart-http-1-1-6--released
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章