page3.ssjs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. print = conn.write || print
  2. opts = [
  3. "cgi_pattern",
  4. "cgi_environment",
  5. "put_delete_auth_file",
  6. "cgi_interpreter",
  7. "protect_uri",
  8. "authentication_domain",
  9. "ssi_pattern",
  10. "throttle",
  11. "access_log_file",
  12. "enable_directory_listing",
  13. "error_log_file",
  14. "global_auth_file",
  15. "index_files",
  16. "enable_keep_alive",
  17. "access_control_list",
  18. "extra_mime_types",
  19. "listening_ports",
  20. "document_root",
  21. "fallback_document_root",
  22. "ssl_certificate",
  23. "num_threads",
  24. "prespawn_threads",
  25. "run_as_user",
  26. "url_rewrite_patterns",
  27. "hide_files_patterns",
  28. "request_timeout_ms",
  29. "websocket_timeout_ms",
  30. "decode_url",
  31. "lua_preload_file",
  32. "lua_script_pattern",
  33. "lua_server_page_pattern",
  34. "_experimental_duktape_script_pattern",
  35. "websocket_root",
  36. "fallback_websocket_root",
  37. "lua_websocket_pattern",
  38. "access_control_allow_origin",
  39. "error_pages",
  40. "_unknown__option"
  41. ]
  42. // send a header
  43. print('HTTP/1.0 200 OK\r\n');
  44. print('Content-Type: text/html\r\n');
  45. print('\r\n');
  46. print("<html><body>\n");
  47. print("<p>This example page is generated by the ");
  48. print('<a href="https://github.com/civetweb/civetweb">CivetWeb web server</a>');
  49. print(" with server side javascript.</p>\n");
  50. for (var i=0; i < opts.length; i++) {
  51. var o = opts[i];
  52. var n = civetweb.getoption(o);
  53. if (typeof(n) == "string") {
  54. print("<p>Option " + o + " = " + n + "</p>\n");
  55. } else {
  56. print("<p>Option " + o + " not known</p>\n");
  57. }
  58. }
  59. print("</body></html>\n");