Webdis - 一個快速的 Redis HTTP 接口
Webdis是一個簡單的 HTTP 服務器。它將操作命令轉發至Redis,然后按你選擇的格式送發請求返回。它用到了 hiredis, jansson, libevent, 和 http-parser這些第三訪包。支持以下特性:
- 支持GET 和 POST,和
PUT用于文件上傳
- 默認返回輸出JSON,optional JSONP parameter (
?jsonp=myFunction
or?callback=myFunction
). - Raw Redis 2.0 protocol output with
.raw
suffix - MessagePack output with
.msg
suffix - HTTP 1.1 pipelining (70,000 http requests per second on a desktop Linux machine.)
- Multi-threaded server, configurable number of worker threads.
- WebSocket support (Currently using the “hixie-76” specification).
- Connects to Redis using a TCP or UNIX socket.
- Restricted commands by IP range (CIDR subnet + mask) or HTTP Basic Auth, returning 403 errors.
- Possible Redis authentication in the config file.
- Pub/Sub using
Transfer-Encoding: chunked
, works with JSONP as well. Webdis can be used as a Comet server. - Drop privileges on startup.
- Custom Content-Type using a pre-defined file extension, or with
?type=some/thing
. - URL-encoded parameters for binary data or slashes and question marks. For instance,
%2f
is decoded as/
but not used as a command separator. - Logs, with a configurable verbosity.
- Cross-origin requests, usable with XMLHttpRequest2 (Cross-Origin Resource Sharing - CORS).
- File upload with PUT.
- With the JSON output, the return value of INFO is parsed and transformed into an object.
- Optional daemonize.
- Default root object: Add
"default_root": "/GET/index.html"
in webdis.json to substitute the request to/
with a Redis request. - HTTP request limit with
http_max_request_size
(in bytes, set to 128MB by default). - Database selection in the URL, using e.g.
/7/GET/key
to run the command on DB 7.
</ul>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!