smart-http
smart-http is a relatively simple http server, the communication core uses smart-socket latest version v1.4.4
.
And because of the use of smart-socket, the server's performance is still very good, in my 4-core CPU can run out of 73W qps +.
smart-socket performance of each test are based on the server, we believe that smart-http performance will not let you down.
function list
- Supports GET, POST HTTP request.
- Provide a URL routing component, you can quickly set up a static server.
- Support section RFC2612 specification, follow-up will gradually improve.
- Https protocol support, enabling the smart-socket for.
- Have the ability to upload files.
Fast Experience
- The introduction of smart-http depend on your Maven project.
<dependency> <groupId>org.smartboot.http</groupId> <artifactId>smart-http-parent</artifactId> <version>1.0.10</version> <type>pom</type> </dependency>
- Copy the code and start.
public class SimpleSmartHttp { public static void main(String[] args) { HttpBootstrap bootstrap = new HttpBootstrap(); bootstrap.pipeline().next(new HttpHandle() { public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.write("hello world".getBytes()); } }); bootstrap.setPort(8080).start(); } }
- Browser access: HTTP: // localhost: 8080 /
Within the project also provides an example of a static file server, welcomed into the pit experience.