[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5428 - / libmicrohttpd-docs libmicrohttpd-docs/WWW
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5428 - / libmicrohttpd-docs libmicrohttpd-docs/WWW |
Date: |
Wed, 8 Aug 2007 15:14:40 -0600 (MDT) |
Author: grothoff
Date: 2007-08-08 15:14:37 -0600 (Wed, 08 Aug 2007)
New Revision: 5428
Added:
libmicrohttpd-docs/
libmicrohttpd-docs/WWW/
libmicrohttpd-docs/WWW/index.php
Log:
docs
Added: libmicrohttpd-docs/WWW/index.php
===================================================================
--- libmicrohttpd-docs/WWW/index.php (rev 0)
+++ libmicrohttpd-docs/WWW/index.php 2007-08-08 21:14:37 UTC (rev 5428)
@@ -0,0 +1,164 @@
+<?php
+include("i18nHTML/i18nhtml.php");
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("libmicrohttpd: a library for creating an embedded HTTP server");
+if ($description) {
+ echo "<meta name=\"description\" content=\"";
+ TRANSLATE("A small C library that makes it easy to run an HTTP server as
part of another application.");
+ echo "\">";
+ }
+?>
+<meta name="author" content="Christian Grothoff">
+<meta name="keywords"
content="libmicrohttpd,http,daemon,server,library,C,GPL,free,Linux,GNU,GPL">
+<meta name="robots" content="index,follow">
+<meta name="revisit-after" content="28 days">
+<meta name="publisher" content="Christian Grothoff">
+<meta name="date" content="2007-08-08">
+<meta name="rights" content="(C) 2007 by Christian Grothoff>";
+<meta http-equiv="expires" content="43200">
+</head>
+<body>
+<?php
+generateLanguageBar();
+
+H1("libmicrohttpd");
+ANCHOR("about");
+H2("About");
+BP();
+W("libmicrohttpd is a small C library that is supposed to make it easy to run
an HTTP server as part of another application.");
+W("Key features that distinguish libmicrohttpd from other projects are:");
+echo "<ul>":
+LI("C library: fast and small");
+LI("API is simple, expressive and fully reentrant");
+LI("Implementation is (largely) http 1.1 compliant");
+LI("HTTP server can listen on multiple ports");
+echo "</ul>":
+W("libmicrohttpd was started because the author needed an easy way to add a
concurrent HTTP server to other projects.");
+W("Existing alternatives were either non-free, not reentrant, standalone, of
terrible code quality or a combination thereof.");
+W("Do not use libmicrohttpd if you are looking for a standalone http server,
there are many other projects out there that provide that kind of functionality
already.");
+W("However, if you want to be able to serve simple WWW pages from within your
C or C++ application, check it out.");
+P();
+W("libmicrohttpd is licensed under the %s.",
+ extlink_("http://www.gnu.org/licenses/gpl.html","GNU GPL"));
+EP();
+
+ANCHOR("download");
+H2("Download");
+BP();
+W("You can find the current release %s.",
+ extlink_("download/libmicrohttpd-0.0.0.tar.gz", "here"));
+W("The latest version can be obtained using");
+PRE("$ svn checkout https://gnunet.org/svn/libmicrohttpd/");
+W("libmicrohttpd has no dependencies; however, the textcases use %s.",
+ extlink_("http://curl.haxx.se/libcurl/","libcurl"));
+P();
+W("If you want to be notified about updates, subscribe to %s",
+ extlink_("http://freshmeat.net/projects/libmicrohttpd/", "libmicrohttpd on
freshmeat"));
+EP();
+
+ANCHOR("using");
+H2("Using libmicrohttpd");
+BP();
+W("Here is a minimal example (included in the distribution):");
+?>
+<pre>
+#include <microhttpd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#define PAGE "<html><head><title>libmicrohttpd demo</title>"\
+ "</head><body>libmicrohttpd demo</body></html>"
+
+static int apc_all(void * cls,
+ const struct sockaddr * addr,
+ socklen_t addrlen) {
+ return MHD_YES; /* accept connections from anyone */
+}
+
+static int ahc_echo(void * cls,
+ struct MHD_Connection * connection,
+ const char * url,
+ const char * method,
+ const char * upload_data,
+ const char * version,
+ unsigned int * upload_data_size) {
+ const char * me = cls;
+ struct MHD_Response * response;
+ int ret;
+
+ if (0 != strcmp(method, "GET"))
+ return MHD_NO; /* unexpected method */
+ response = MHD_create_response_from_data(strlen(me),
+ (void*) me,
+ MHD_NO,
+ MHD_NO);
+ ret = MHD_queue_response(connection,
+ MHD_HTTP_OK,
+ response);
+ MHD_destroy_response(response);
+ return ret;
+}
+
+int main(int argc,
+ char ** argv) {
+ struct MHD_Daemon * d;
+ if (argc != 3) {
+ printf("%s PORT SECONDS-TO-RUN\n",
+ argv[0]);
+ return 1;
+ }
+ d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION,
+ atoi(argv[1]),
+ &apc_all,
+ NULL,
+ &ahc_echo,
+ PAGE,
+ MHD_OPTION_END);
+ if (d == NULL)
+ return 1;
+ sleep(atoi(argv[2]));
+ MHD_stop_daemon(d);
+ return 0;
+}
+</pre>
+<?php
+P();
+W("For more information about the API, study the <tt>microhttpd.h</tt> include
file.");
+EP();
+
+ANCHOR("mantis");
+H2("Bugtrack");
+BP();
+W("libmicrohttpd uses Mantis for bugtracking.");
+W("Visit %s to report bugs.",
+ extlink_("https://gnunet.org/mantis/","https://gnunet.org/mantis/"));
+W("You need to sign up for a reporter account.");
+W("Please make sure you report bugs under <strong>libmicrohttpd</strong> and
not under any of the other projects.");
+P();
+W("If you dislike Mantis and need to report a bug contact %s via e-mail.",
+ extlink_("mailto:address@hidden","address@hidden"));
+EP();
+
+ANCHOR("alternatives");
+H2("Alternatives");
+echo "<ul>";
+LILI("http://www.hughes.com.au/products/libhttpd/",
+ "libhttpd (C)");
+LILI("http://www.w3.org/Library/",
+ "libWWW (C)");
+LILI("http://xaxxon.slackworks.com/ehs/html/",
+ "EHS (C++)");
+LILI("http://www.nightmare.com/medusa/",
+ "Medusa (Python)");
+echo "</ul>";
+HR();
+echo "<address><a href=\"mailto:address@hidden">Christian
Grothoff</a></address>";
+PRE("Copyright (C) 2007 Christian Grothoff.\n" .
+ "Verbatim copying and distribution of this entire article\n" .
+ "is permitted in any medium, provided this notice is preserved.");
+BR();
+generateFooter();
+echo "</body></html>\n";
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5428 - / libmicrohttpd-docs libmicrohttpd-docs/WWW,
gnunet <=