All Projects → jixinqi → lazurite

jixinqi / lazurite

Licence: other
A simple http server.

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to lazurite

foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 61 (+258.82%)
Mutual labels:  http-server
quickserv
Dangerously user-friendly web server for quick prototyping and hackathons
Stars: ✭ 275 (+1517.65%)
Mutual labels:  http-server
yarx
An awesome reverse engine for xray poc. | 一个自动化根据 xray poc 生成对应 server 的工具
Stars: ✭ 229 (+1247.06%)
Mutual labels:  http-server
go-fileserver
A simple HTTP Server to share files over WiFi via Qr Code
Stars: ✭ 68 (+300%)
Mutual labels:  http-server
shivneri
Component based MVC web framework based on fort architecture targeting good code structures, modularity & performance.
Stars: ✭ 21 (+23.53%)
Mutual labels:  http-server
fs-over-http
A filesystem interface over http, with extras and docker support
Stars: ✭ 14 (-17.65%)
Mutual labels:  http-server
http-accept
Parse Accept and Accept-Language HTTP headers in Ruby.
Stars: ✭ 69 (+305.88%)
Mutual labels:  http-server
kog
🌶 A simple Kotlin web framework inspired by Clojure's Ring.
Stars: ✭ 41 (+141.18%)
Mutual labels:  http-server
go-oryx-lib
The public multiple media library for https://github.com/ossrs/go-oryx.
Stars: ✭ 98 (+476.47%)
Mutual labels:  http-server
restana
Super fast and minimalist framework for building REST micro-services.
Stars: ✭ 380 (+2135.29%)
Mutual labels:  http-server
ts-httpexceptions
🚦 See https://tsed.io/docs/exceptions.html
Stars: ✭ 24 (+41.18%)
Mutual labels:  http-server
nhttp
An Simple http framework for Deno, Deno Deploy and Cloudflare Workers. so hot 🚀
Stars: ✭ 26 (+52.94%)
Mutual labels:  http-server
httpbun
A simple HTTP server with responses tuned to be useful in testing HTTP clients. Heavily inspired by httpbin, but doesn't intend to be a perfect clone.
Stars: ✭ 14 (-17.65%)
Mutual labels:  http-server
DataXServer
为DataX(https://github.com/alibaba/DataX) 提供远程多语言调用(ThriftServer,HttpServer) 分布式运行(DataX on YARN) 功能
Stars: ✭ 130 (+664.71%)
Mutual labels:  http-server
toyhttpd
I/O 模型练手代码,分别使用阻塞式 I/O、select、poll 和 epoll 和 Java NIO 实现了简单的 HTTP Server
Stars: ✭ 43 (+152.94%)
Mutual labels:  http-server
http-live-simulator
A simple HTTP Server that serves with random delay for live simulation
Stars: ✭ 58 (+241.18%)
Mutual labels:  http-server
eephttpd
Serving simple static sites directly to i2p via the SAM API. (Also part of https://github.com/eyedeekay/sam-forwarder)
Stars: ✭ 15 (-11.76%)
Mutual labels:  http-server
Swiftly
Swiftly is an easy to use Qt/C++ web framework
Stars: ✭ 20 (+17.65%)
Mutual labels:  http-server
cs
开箱即用的基于命令的消息处理框架,让 websocket 和 tcp 开发就像 http 那样简单
Stars: ✭ 19 (+11.76%)
Mutual labels:  http-server
node-slack-events-api
Slack Events API for Node
Stars: ✭ 93 (+447.06%)
Mutual labels:  http-server

lazurite

Lazurite 是一个基于 BOOST::ASIO 的 HTTP 服务器,可在 Linux 和 Windows 系统上运行。

Lazurite 包含了 Socket I/O 模块,HTTP 数据包 Parser 模块,以及 HTTP 路由模块。

目前该服务器仍然是开发阶段,仅仅支持 GET 请求,可以用做简单的 API 响应。

使用实例:

  1. 显示 Hello world 页面。
// main.cpp

#include "lazurite_core.h"

std::string hello_page(lazurite::http::request &_request, lazurite::http::response &_response)
{
    return "hello_world\n";
}

int main()
{
    lazurite::http::server http_server;
    http_server.add_route("/",hello_page);
    http_server.run();
}

编译并运行,用 curl 查看:

# curl http://127.0.0.1:8000
hello_world
  1. 显示原始请求报文页面。
std::string raw_msg(lazurite::http::request &_request, lazurite::http::response &_response)
{
    return _request.raw_msg();
}

http_server.add_route("/raw_msg",raw_msg);

运行结果:

# curl http://127.0.0.1:8000/raw_msg
GET /raw_msg HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: curl/7.29.0
Accept: */*
Connection: keep-alive
  1. 响应 404。

任何未添加 route 的 uri 都会响应 404

# curl http://127.0.0.1:8000/a
404 Not Found
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].