This is a simplest HTTP server made of libMiMic. It will echo back a request path.
Dependencies: libMiMic mbed-rtos mbed NySDFileSystem
最も簡単なhttpdです。 クライアントから送信されてきたURLをHtmlにして返します。
ModUrlモジュールのサンプルでもあります。
This program is simple httpserver.
This is tutorial for ModUrl module.
Revision 9:a70e98dd2a25, committed 2013-08-09
- Comitter:
- nyatla
- Date:
- Fri Aug 09 09:07:24 2013 +0000
- Parent:
- 8:eab4366dd70c
- Child:
- 10:097f76253b0d
- Commit message:
- update libMiMic;
Changed in this revision
libMiMic.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/libMiMic.lib Thu Jul 11 03:55:51 2013 +0000 +++ b/libMiMic.lib Fri Aug 09 09:07:24 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/nyatla/code/libMiMic/#61edfd4b16ee +http://mbed.org/users/nyatla/code/libMiMic/#5f993fccc09c
--- a/main.cpp Thu Jul 11 03:55:51 2013 +0000 +++ b/main.cpp Fri Aug 09 09:07:24 2013 +0000 @@ -1,16 +1,17 @@ #include "mimic.h" - LocalFileSystem2 lf("local"); + /** - * + * This program is simplest httpd. + * The program echo back yuor request in html. */ class SimpleHttpd:public MiMic::Httpd { private: ModUrl modurl; //basic URL parser public: - SimpleHttpd(NetConfig& i_cfg):Httpd(i_cfg._inst.services.http_port) + SimpleHttpd(NetConfig& i_cfg):Httpd(i_cfg.getHttpPort()) { } virtual void onRequest(HttpdConnection& i_connection) @@ -41,6 +42,8 @@ //try to override setting by local file. cfg.loadFromFile("/local/mimic.cfg"); + cfg.setSrvUPnP(false);//disable UPnP + cfg.setSrvMdns(false);//disable mDNS SimpleHttpd httpd(cfg); //create a httpd instance. net.start(cfg);