GoAhead
嵌入式web服务器有:GoAhead、Boa、lighttpd、mini_httpd、shttpd、appweb和apache
1、GpAhead Web 服务器特性
1)GoAhead Web 服务器非常小巧
2)性能方面,在266MHz的Pentium处理器上它的相映速度可达到59次/秒;
3)GoAhead Web 服务器提供很多优秀的服务特性,支持ASP和嵌入式Javascript
4)支持标准的CGI处理以及良好的加密和用户管理功能
5)支持多种操作系统,如Linux、Windows CE、VxWorkd
6)扩展的API,GoAhead提供许多接口函数
GoAhead 核心
asp过程: 用来生成显示在页面中的动态数据
GoForm过程: 用来处理用户输入和修改设置
1、asp过程
创建函数定义
int aspCreateCurrentUser(int ejid, webs_t wp, int argc, char_t **argv);
ejid: jacascript解释器句柄,可以调用jacascript相关函数
wp: 浏览器句柄,可以调用很多GoAhead服务器函数
argc: 传递asp过程的实参个数
argv: 传递asp过程的实参内容
注册创建函数
websAspDefine(T("CreateCurrentUser"), aspCreateCurrentUser);
调用
asp页面中出现<% CreateCurrentUser();%>
-->webserver 会调用aspCreateCurrentUser()来输出页面。
2、GoForm过程
GoForm实现为一个URL处理器,它会解释以"/goform"开始的URL
通过websFormDefine函数调用进行关联
eg : <form action = /goform/AddGroup method = POST ></form>
注册Form 提交函数
websFormDefine(T("AddDroup"),do_action_xx());
goahead项目框架目录
-restapi *
-xx_handler.c
-xx_handler.h
...
-web-BMC
- web 页面(images、inclued、js、lang、.asp)
-action.c
-auth.c
-goahead.c
-http.c
-Makefile
-restapi.c *--websFormDefine--
-route.c
-socket.c
-utils.c
...