;**************************** ;* ;* Lihaso Web Server ;* ;* HTTP/HTTPS example extended Server ;* ;* (c)2015 - 2021 by Linder Hard- und Software ;* ;* EnableExplicit ;* ;* Includes: ;* XIncludeFile "lhs_lib/SYS/lhs_log.pbi" ;Currently for Debugging XIncludeFile "lhs_lib/SYS/lhs_log_ext.pbi" ;User for Access Log, Error Access Log, Error Log and maybe more. XIncludeFile "lweb_header.pbi" XIncludeFile "lweb.pbi" ;* ;* Variable declaration: ;* Define counter, v_lweb_srv_stop Define Accesslog.s, Errorlog.s, Cachelog.s ;* ;* Basic Debug Log initialization: ;* lhs_log::App_Name = "http-s_server_example" lhs_log::SetLogFile("http-s_server_example_debug.log") lhs_log::SetMaxSize(32) lhs_log::SetLogDateFormat("%yyyy.%mm.%dd %hh:%ii:%ss") lhs_log::SetLogFileDateFormat("%yyyy_%mm_%dd_%hh_%ii_%ss") lhs_log::Init() ;* ;* Enable extended Logging: ;* Accesslog = lhs_log_ext::Create("Accesslog") Errorlog = lhs_log_ext::Create("Errorlog") Cachelog = lhs_log_ext::Create("Cachelog") lhs_log::Out("Errorlog UUID:"+Errorlog) lhs_log::Out("Accesslog UUID:"+Accesslog) lhs_log::Out("Cachelog UUID:"+Cachelog) lhs_log_ext::SetLogFile(Accesslog, "http-s_access.log") lhs_log_ext::SetLogFile(Errorlog, "http-s_error.log") lhs_log_ext::SetLogFile(Cachelog, "http-s_cache.log") lhs_log_ext::Init(Accesslog) lhs_log_ext::Init(Errorlog) lhs_log_ext::Init(Cachelog) lhs_web::set_config(lhs_web::#conf_Access_logUUID, Accesslog) lhs_web::set_config(lhs_web::#conf_Error_logUUID, ErrorLog) lhs_web::set_config(lhs_web::#conf_Cache_logUUID, Cachelog) lhs_web::set_config(lhs_web::#conf_HTTP_port, "8084") ;lhs_web::set_config(lhs_web::#conf_binding, "127.0.0.1") lhs_web::set_config(lhs_web::#conf_HTTP_binding, "0.0.0.0") lhs_web::set_config(lhs_web::#conf_HTTPS_CA, "fullchain.pem") lhs_web::set_config(lhs_web::#conf_HTTPS_Cert, "cert.pem") lhs_web::set_config(lhs_web::#conf_HTTPS_Key, "privkey.pem") lhs_web::set_config(lhs_web::#conf_HTTPS_Key_Pass, "") lhs_web::set_config(lhs_web::#conf_HTTPS_Binding, "0.0.0.0") lhs_web::set_config(lhs_web::#conf_HTTPS_Port, "8446") lhs_web::set_config(lhs_web::#conf_HTTPS_Enable, "1") lhs_web::set_config(lhs_web::#conf_defaultfile, "index.html") lhs_web::set_config(lhs_web::#conf_basedir, "/home/renlin/testweb/") lhs_web::set_config(lhs_web::#conf_error400, "integrated") lhs_web::set_config(lhs_web::#conf_max_HTTP_clients, "100") lhs_web::set_config(lhs_web::#conf_max_HTTPS_clients, "100") lhs_web::set_config(lhs_web::#conf_cache_enable, "0") ;* ;* includes ;* Procedure.s Sample_Header(Map Header.s()) Define *Text Define.s Encoded, ZumSenden, TBD, Text NewMap Response.s() If Header("cookie:") <> "" lhs_log::Out("A Cookie is set :" + Header("cookie:")) Else lhs_log::Out("No Cookie.") EndIf TBD="