smart-http轻量级的开源 HTTP 服务器
smart-http 是一款采用 Java 语言编写的 Http 服务器,有别于业界知名的 Web容器:Tomcat、Undertow,smart-http 并不支持 Servlet 规范,但对于 Http 服务器所需的各项能力,它都具备。
smart-http 天生就是异步非阻塞的 I/O 模型,因为其通信内核采用了 smart-socket。所以无论是性能还是稳定性,都是非常出色的。 在 4核 2.9GHz 的电脑下服务启动耗时毫秒级,压测的 QPS 可达 73W,流量传输效率每秒突破百兆。
更新内容
- 支持任意Method的Http请求(GET、POST、PUT、自定义)
- 提供了URL路由组件,可以快速搭建一套静态服务器。
- 支持部分RFC2612规范,后续会逐渐完善。
- 支持Https协议,由smart-socket为其赋能。
- 具备文件上传的能力。
- 支持 websocket
快速体验
- 在您的Maven工程中引入smart-http依赖。
<dependency> <groupId>org.smartboot.http</groupId> <artifactId>smart-http-server</artifactId> <version>1.0.13</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
评论
Knod轻量级 HTTP 服务器
Knod是一个轻量级的HTTP服务器,旨在促进前端开发相应的后端缺失或不完整。支持GET,PUT,POST,PATCH,和DELETE,无需依赖其他Ruby库。
Knod轻量级 HTTP 服务器
0
JQHttpServer基于Qt轻量级HTTP服务器
JQHttpServer是一个基于Qt开发的轻量级HTTP服务器。目前支持GET和POST两个协议。底层有TcpSocket和LocalSocket两个版本,方便使用。用到的Qt库有:corenetw
JQHttpServer基于Qt轻量级HTTP服务器
0
JQHttpServer基于Qt轻量级HTTP服务器
JQHttpServer 是一个基于Qt开发的轻量级HTTP服务器 。目前支持GET和POST两个协
JQHttpServer基于Qt轻量级HTTP服务器
0
UnicornRack 的 HTTP 服务器
Unicorn是一个为运行Rack应用的HTTP服务器。Unicorn 是一个利用Unix的高级特性开发的,只为具备低延迟,高带宽的连接的客户服务的HTTP服务器软件。慢的客户服务需要通过放置一个反向
UnicornRack 的 HTTP 服务器
0
StarmanPSGI 的 HTTP 服务器
Starman是一个高性能、preforking和PSGI兼容的HTTP服务器,支持HTTP/1.1、多网络接口支持以及UnixDomain套接字支持,可无缝进行重启,支持通过操作系统信号进行动态的w
StarmanPSGI 的 HTTP 服务器
0