|
@@ -18,11 +18,19 @@
|
|
|
|
|
|
|
|
|
|
#define DOCUMENT_ROOT "."
|
|
#define DOCUMENT_ROOT "."
|
|
|
|
+#ifdef NO_SSL
|
|
#ifdef USE_IPV6
|
|
#ifdef USE_IPV6
|
|
#define PORT "[::]:8888"
|
|
#define PORT "[::]:8888"
|
|
#else
|
|
#else
|
|
#define PORT "8888"
|
|
#define PORT "8888"
|
|
#endif
|
|
#endif
|
|
|
|
+#else
|
|
|
|
+#ifdef USE_IPV6
|
|
|
|
+#define PORT "[::]:8888r,[::]:8843s"
|
|
|
|
+#else
|
|
|
|
+#define PORT "8888r,8843s"
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
#define EXAMPLE_URI "/example"
|
|
#define EXAMPLE_URI "/example"
|
|
#define EXIT_URI "/exit"
|
|
#define EXIT_URI "/exit"
|
|
int exitNow = 0;
|
|
int exitNow = 0;
|
|
@@ -320,6 +328,10 @@ main(int argc, char *argv[])
|
|
"websocket_timeout_ms",
|
|
"websocket_timeout_ms",
|
|
"3600000",
|
|
"3600000",
|
|
#endif
|
|
#endif
|
|
|
|
+#ifndef NO_SSL
|
|
|
|
+ "ssl_certificate",
|
|
|
|
+ "../../resources/cert/server.pem",
|
|
|
|
+#endif
|
|
0};
|
|
0};
|
|
struct mg_callbacks callbacks;
|
|
struct mg_callbacks callbacks;
|
|
struct mg_context *ctx;
|
|
struct mg_context *ctx;
|
|
@@ -344,7 +356,14 @@ main(int argc, char *argv[])
|
|
err = 1;
|
|
err = 1;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
|
|
+#ifndef NO_SSL
|
|
|
|
+ if (!mg_check_feature(2)) {
|
|
|
|
+ fprintf(stderr,
|
|
|
|
+ "Error: Embedded example built with SSL support, "
|
|
|
|
+ "but civetweb library build without.\n");
|
|
|
|
+ err = 1;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
if (err) {
|
|
if (err) {
|
|
fprintf(stderr, "Cannot start CivetWeb - inconsistent build.\n");
|
|
fprintf(stderr, "Cannot start CivetWeb - inconsistent build.\n");
|
|
return EXIT_FAILURE;
|
|
return EXIT_FAILURE;
|