|
@@ -1,3 +1,5 @@
|
|
|
|
|
+[](https://travis-ci.org/ithewei/hw)
|
|
|
|
|
+
|
|
|
## Intro
|
|
## Intro
|
|
|
|
|
|
|
|
hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
@@ -12,6 +14,25 @@ hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
|
|
|
|
|
|
- c++11
|
|
- c++11
|
|
|
|
|
|
|
|
|
|
+## Getting Started
|
|
|
|
|
+```shell
|
|
|
|
|
+git clone https://github.com/ithewei/hw.git
|
|
|
|
|
+cd hw
|
|
|
|
|
+make httpd curl
|
|
|
|
|
+
|
|
|
|
|
+bin/httpd -d
|
|
|
|
|
+ps aux | grep httpd
|
|
|
|
|
+
|
|
|
|
|
+# http web service
|
|
|
|
|
+bin/curl -v localhost:8080
|
|
|
|
|
+
|
|
|
|
|
+# indexof
|
|
|
|
|
+bin/curl -v localhost:8080/downloads/
|
|
|
|
|
+
|
|
|
|
|
+# http api service
|
|
|
|
|
+bin/curl -v -X POST localhost:8086/v1/api/json -H "Content-Type:application/json" -d '{"user":"admin","pswd":"123456"}'
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
## Module
|
|
## Module
|
|
|
|
|
|
|
|
### data-structure
|
|
### data-structure
|
|
@@ -54,9 +75,16 @@ hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
|
### event
|
|
### event
|
|
|
- hloop.h: 事件循环
|
|
- hloop.h: 事件循环
|
|
|
|
|
|
|
|
|
|
+#### iowatcher
|
|
|
|
|
+- EVENT_SELECT
|
|
|
|
|
+- EVENT_POLL
|
|
|
|
|
+- EVENT_EPOLL (linux only)
|
|
|
|
|
+- EVENT_KQUEUE (mac/bsd)
|
|
|
|
|
+- EVENT_IOCP (windows only)
|
|
|
|
|
+
|
|
|
### http
|
|
### http
|
|
|
- http_client.h: http客户端
|
|
- http_client.h: http客户端
|
|
|
-- http_server.h: http服务端
|
|
|
|
|
|
|
+- HttpServer.h: http服务端
|
|
|
|
|
|
|
|
### other
|
|
### other
|
|
|
|
|
|
|
@@ -76,7 +104,7 @@ hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
|
- make udp: udp server
|
|
- make udp: udp server
|
|
|
- make nc: network client
|
|
- make nc: network client
|
|
|
- make nmap: host discovery
|
|
- make nmap: host discovery
|
|
|
-- make httpd: http服务(包含web service和api service)
|
|
|
|
|
|
|
+- make httpd: http服务(包含web service和api service)
|
|
|
- make curl: 基于libcurl封装http客户端
|
|
- make curl: 基于libcurl封装http客户端
|
|
|
|
|
|
|
|
### tests
|
|
### tests
|
|
@@ -93,5 +121,10 @@ hw 是一套跨平台c/c++基础组件,函数名/类名以h/H开头
|
|
|
#### compile WITH_CURL
|
|
#### compile WITH_CURL
|
|
|
- make DEFINES="WITH_CURL CURL_STATICLIB"
|
|
- make DEFINES="WITH_CURL CURL_STATICLIB"
|
|
|
|
|
|
|
|
-### compile WITH_NGHTTP2
|
|
|
|
|
|
|
+#### compile WITH_NGHTTP2
|
|
|
- make DEFINES=WITH_NGHTTP2
|
|
- make DEFINES=WITH_NGHTTP2
|
|
|
|
|
+
|
|
|
|
|
+#### other features
|
|
|
|
|
+- USE_MULTIMAP
|
|
|
|
|
+- WITH_WINDUMP
|
|
|
|
|
+- ENABLE_IPV6
|