├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── bits ├── appweb.es └── packs │ ├── cgi.pak │ ├── dir.pak │ ├── ejscript.pak │ ├── esp.pak │ └── php.pak ├── configure ├── doc ├── api │ ├── api.css │ ├── apiFooter.tem │ ├── appweb.dox │ ├── appweb.dtags │ ├── appweb.html │ ├── appweb.tags │ ├── appwebBare.html │ ├── appwebBare.tags │ ├── appwebBase.html │ ├── appwebBase.tags │ ├── appwebHeader.tem │ ├── esp.dox │ ├── esp.dtags │ ├── esp.html │ ├── esp.tags │ ├── espBare.html │ ├── espBare.tags │ ├── espBase.html │ ├── espBase.tags │ ├── espHeader.tem │ ├── http.dtags │ ├── http.html │ ├── http.tags │ ├── httpBare.html │ ├── httpBare.tags │ ├── httpHeader.tem │ ├── mpr.dtags │ ├── mpr.html │ ├── mpr.tags │ ├── mprBare.html │ ├── mprBare.tags │ ├── mprHeader.tem │ ├── native.html │ └── stability.html ├── doc.bit ├── doc.css ├── dsi │ ├── bottom.html │ ├── espSeeAlso.html │ ├── genSeeAlso.html │ ├── gettingSeeAlso.html │ ├── head.html │ ├── installSeeAlso.html │ ├── progGuideSeeAlso.html │ ├── progRefSeeAlso.html │ ├── see.html │ ├── sourceSeeAlso.html │ ├── usersGuideSeeAlso.html │ └── webFrameSeeAlso.html ├── favicon.ico ├── guide │ ├── appweb │ │ ├── features.html │ │ ├── goals.html │ │ ├── internals.html │ │ ├── overview.html │ │ ├── programmers │ │ │ ├── embedding.html │ │ │ ├── handlers.html │ │ │ ├── index.html │ │ │ ├── man.html │ │ │ ├── migrating-2-3.html │ │ │ ├── migrating.html │ │ │ ├── modules.html │ │ │ ├── rom.html │ │ │ └── stages.html │ │ ├── source │ │ │ ├── building.html │ │ │ ├── index.html │ │ │ ├── openwrt.html │ │ │ └── porting.html │ │ ├── standards │ │ │ ├── http.html │ │ │ └── index.html │ │ ├── users │ │ │ ├── authentication.html │ │ │ ├── caching.html │ │ │ ├── cgi.html │ │ │ ├── client.html │ │ │ ├── configuration.html │ │ │ ├── dir │ │ │ │ ├── auth.html │ │ │ │ ├── dir.html │ │ │ │ ├── ejs.html │ │ │ │ ├── esp.html │ │ │ │ ├── log.html │ │ │ │ ├── module.html │ │ │ │ ├── perf.html │ │ │ │ ├── route.html │ │ │ │ ├── sandbox.html │ │ │ │ ├── server.html │ │ │ │ ├── ssl.html │ │ │ │ └── vhost.html │ │ │ ├── ejs.html │ │ │ ├── faq.html │ │ │ ├── frameworks.html │ │ │ ├── gettingStarted.html │ │ │ ├── index.html │ │ │ ├── lang.html │ │ │ ├── logFiles.html │ │ │ ├── modules.html │ │ │ ├── php.html │ │ │ ├── ports.html │ │ │ ├── quickStart.html │ │ │ ├── routing.html │ │ │ ├── sandboxing.html │ │ │ ├── security.html │ │ │ ├── service.html │ │ │ ├── ssl.html │ │ │ ├── sslOverview.html │ │ │ ├── stages.html │ │ │ ├── starting.html │ │ │ └── vhosts.html │ │ └── uses.html │ └── esp │ │ └── users │ │ ├── ajax.html │ │ ├── config.html │ │ ├── controllers.html │ │ ├── controls.html │ │ ├── database.html │ │ ├── dynamic.html │ │ ├── generator.html │ │ ├── index.html │ │ ├── mvc.html │ │ ├── mvcTour.html │ │ ├── sessions.html │ │ ├── template.html │ │ ├── tour.html │ │ └── using.html ├── iehacks.css ├── images │ ├── appweb.bmp │ ├── appweb.ico │ ├── appwebArchitecture.gif │ ├── banner.gif │ ├── banner.jpg │ ├── banner.psd │ ├── bannerClouds.jpg │ ├── board.jpg │ ├── bottomShadow.jpg │ ├── bottomShadow.png │ ├── caching │ │ └── caching-steps.jpg │ ├── ejsArchitecture.jpg │ ├── ejsWebView.jpg │ ├── esp │ │ ├── template │ │ │ ├── compile.jpeg │ │ │ └── layout.jpeg │ │ └── tour │ │ │ ├── count10.png │ │ │ ├── create.png │ │ │ ├── error.png │ │ │ ├── hello-dynamic.png │ │ │ ├── hello-layout.png │ │ │ ├── hello.png │ │ │ ├── home-link.png │ │ │ ├── home.png │ │ │ ├── post-list.png │ │ │ ├── tabs.png │ │ │ └── validate.png │ ├── espArchitecture.jpg │ ├── form.png │ ├── jquery.gif │ ├── modules.jpg │ ├── mvc.jpg │ ├── nslu2.jpg │ ├── pipeline.jpg │ ├── pixel.gif │ ├── proxied.jpg │ ├── routeSteps.jpg │ ├── routing.jpg │ ├── scalable.jpg │ ├── services.jpg │ ├── shadow.jpg │ ├── shadow.png │ └── tray.jpg ├── index.html ├── licenses │ ├── gpl.html │ └── index.html ├── man │ ├── appman.1 │ ├── appman.html │ ├── appman.txt │ ├── appweb.1 │ ├── appweb.html │ ├── appweb.txt │ ├── appwebMonitor.1 │ ├── appwebMonitor.html │ ├── appwebMonitor.txt │ ├── authpass.1 │ ├── authpass.html │ ├── authpass.txt │ ├── esp.1 │ ├── esp.html │ ├── esp.txt │ ├── http.1 │ ├── http.html │ ├── http.txt │ ├── makerom.1 │ ├── makerom.html │ ├── makerom.txt │ ├── manager.1 │ ├── manager.html │ ├── manager.txt │ ├── regexp.3 │ ├── regexp.html │ └── regexp.txt ├── masters │ ├── caching │ │ └── caching-steps.pptx │ ├── esp │ │ └── espArchitecture.pptx │ ├── modules.pptx │ ├── monitor.pptx │ ├── old │ │ ├── appwebArchitecture.ppt │ │ └── routing.pxm │ ├── pipeline.pptx │ ├── proxied.pptx │ ├── routing │ │ ├── routeSteps.pptx │ │ └── routing.pptx │ ├── scalable.pptx │ └── template │ │ ├── compile.pptx │ │ └── layout.pptx ├── print.css ├── product │ ├── README.TXT │ ├── changeLog.html │ ├── changelog │ ├── compatibility.html │ ├── contributors.html │ ├── copyright.html │ ├── install │ │ ├── index.html │ │ ├── inst.txt │ │ ├── linux.html │ │ ├── mac.html │ │ ├── packages.html │ │ ├── uninst.txt │ │ └── windows.html │ ├── project.html │ ├── releaseNotes.html │ ├── roadmap.html │ └── version.html ├── ref │ ├── appweb │ │ ├── architecture.html │ │ ├── ejsArchitecture.html │ │ ├── index.html │ │ ├── memory.html │ │ └── multithread.html │ └── esp │ │ └── espArchitecture.html └── tidy.conf ├── main.bit ├── package ├── Makefile-flat ├── install.sh ├── linkup ├── linux │ ├── appweb.init │ ├── appweb.openwrt │ ├── appweb.upstart │ ├── deb.bin │ │ ├── conffiles │ │ ├── control │ │ ├── postinst │ │ ├── postrm │ │ ├── preinst │ │ └── prerm │ └── rpm.spec ├── macosx │ ├── appweb.pmdoc │ │ ├── 01contents.xml │ │ └── index.xml │ ├── background.png │ ├── com.embedthis.appweb.plist │ ├── license.rtf │ ├── readme.rtf │ └── scripts │ │ ├── postflight │ │ └── preflight ├── package.bit ├── start-flat.bit ├── uninstall.sh └── windows │ ├── LICENSE.TXT │ ├── install.iss │ ├── removeFiles.c │ └── unattended.ans ├── projects ├── appweb-linux-bit.h ├── appweb-linux.mk ├── appweb-linux.sh ├── appweb-macosx-bit.h ├── appweb-macosx.mk ├── appweb-macosx.sh ├── appweb-macosx.xcodeproj │ └── project.pbxproj ├── appweb-solaris-bit.h ├── appweb-solaris.mk ├── appweb-solaris.sh ├── appweb-windows-bit.h ├── appweb-windows.nmake ├── appweb-windows.sh ├── appweb-windows.sln ├── appweb-windows │ ├── appweb.vcxproj │ ├── appwebMonitor.ico.vcxproj │ ├── appwebMonitor.vcxproj │ ├── auth.vcxproj │ ├── authpass.vcxproj │ ├── cgiProgram.vcxproj │ ├── debug.props │ ├── esp-appweb.conf.vcxproj │ ├── esp.conf.vcxproj │ ├── esp.vcxproj │ ├── esp.www.vcxproj │ ├── http.vcxproj │ ├── libappweb.def │ ├── libappweb.vcxproj │ ├── libhttp.def │ ├── libhttp.vcxproj │ ├── libmpr.def │ ├── libmpr.vcxproj │ ├── libmprssl.def │ ├── libmprssl.vcxproj │ ├── libpcre.def │ ├── libpcre.vcxproj │ ├── libsqlite3.def │ ├── libsqlite3.vcxproj │ ├── makerom.vcxproj │ ├── manager.vcxproj │ ├── mod_cgi.def │ ├── mod_cgi.vcxproj │ ├── mod_esp.def │ ├── mod_esp.vcxproj │ ├── mod_php.def │ ├── mod_ssl.def │ ├── php5ts.dll.def │ ├── prep.vcxproj │ ├── product.props │ ├── release.props │ ├── removeFiles.vcxproj │ ├── setConfig.vcxproj │ ├── sqlite.vcxproj │ ├── test-basic.cgi.vcxproj │ ├── test-cache.cgi.vcxproj │ ├── test-cgiProgram.vcxproj │ ├── test-testScript.vcxproj │ ├── test.js.vcxproj │ ├── testAppweb.vcxproj │ ├── x64.props │ └── x86.props ├── idebuild └── windows.bat ├── src ├── appweb.h ├── config.c ├── convenience.c ├── customize.h ├── deps │ ├── http │ │ ├── http.bit │ │ ├── http.c │ │ ├── http.h │ │ └── httpLib.c │ ├── mpr │ │ ├── makerom.c │ │ ├── manager.c │ │ ├── mpr.bit │ │ ├── mpr.h │ │ ├── mprLib.c │ │ └── mprSsl.c │ ├── pcre │ │ ├── pcre.bit │ │ ├── pcre.c │ │ └── pcre.h │ └── sqlite │ │ ├── sqlite.bit │ │ ├── sqlite.c │ │ ├── sqlite3.c │ │ └── sqlite3.h ├── dirHandler.c ├── esp │ ├── edi.c │ ├── edi.h │ ├── esp-app.h │ ├── esp-appweb.conf │ ├── esp.bit │ ├── esp.c │ ├── esp.conf │ ├── esp.h │ ├── espAbbrev.c │ ├── espFramework.c │ ├── espHandler.c │ ├── espHtml.c │ ├── espSession.c │ ├── espTemplate.c │ ├── mdb.c │ ├── mdb.h │ ├── sdb.c │ ├── www-future │ │ └── files │ │ │ ├── layouts │ │ │ └── default.esp │ │ │ └── static │ │ │ ├── images │ │ │ ├── banner.jpg │ │ │ ├── favicon.ico │ │ │ └── splash.jpg │ │ │ ├── index.esp │ │ │ ├── js │ │ │ ├── jquery.esp.js │ │ │ ├── jquery.esp.min.js │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ ├── jquery.simplemodal.min.js │ │ │ ├── jquery.tablesorter.js │ │ │ ├── jquery.tablesorter.min.js │ │ │ ├── jquery.treeview.min.js │ │ │ ├── tree-images │ │ │ │ ├── file.gif │ │ │ │ ├── folder-closed.gif │ │ │ │ ├── folder.gif │ │ │ │ ├── minus.gif │ │ │ │ ├── plus.gif │ │ │ │ ├── treeview-black-line.gif │ │ │ │ ├── treeview-black.gif │ │ │ │ ├── treeview-default-line.gif │ │ │ │ ├── treeview-default.gif │ │ │ │ ├── treeview-famfamfam-line.gif │ │ │ │ ├── treeview-famfamfam.gif │ │ │ │ ├── treeview-gray-line.gif │ │ │ │ ├── treeview-gray.gif │ │ │ │ ├── treeview-red-line.gif │ │ │ │ └── treeview-red.gif │ │ │ └── treeview.css │ │ │ ├── layout.css │ │ │ └── themes │ │ │ └── default.css │ └── www │ │ ├── app.conf │ │ ├── appweb.conf │ │ └── files │ │ ├── layouts │ │ └── default.esp │ │ └── static │ │ ├── images │ │ ├── banner.jpg │ │ ├── favicon.ico │ │ └── splash.jpg │ │ ├── index.esp │ │ ├── js │ │ ├── jquery.esp.js │ │ ├── jquery.js │ │ ├── jquery.simplemodal.js │ │ └── jquery.tablesorter.js │ │ ├── layout.css │ │ └── themes │ │ └── default.css ├── fileHandler.c ├── libappweb.bit ├── log.c ├── modules │ ├── README.md │ ├── cgiHandler.c │ ├── ejsHandler.c │ ├── modules.bit │ ├── phpHandler.c │ ├── proxyHandler.c │ └── sslModule.c ├── samples │ ├── README.md │ ├── c │ │ ├── simpleClient │ │ │ ├── simpleClient.c │ │ │ └── start.bit │ │ ├── simpleEjs │ │ │ ├── index.ejs │ │ │ ├── simpleEjs.c │ │ │ ├── simpleEjs.conf │ │ │ └── start.bit │ │ ├── simpleEsp │ │ │ ├── index.html │ │ │ ├── simpleEsp.c │ │ │ ├── simpleEsp.conf │ │ │ └── start.bit │ │ ├── simpleHandler │ │ │ ├── appweb.conf │ │ │ ├── simpleHandler.c │ │ │ └── start.bit │ │ ├── simpleModule │ │ │ ├── README.md │ │ │ ├── simpleModule.c │ │ │ └── start.bit │ │ ├── simpleServer │ │ │ ├── index.html │ │ │ ├── simpleServer.c │ │ │ ├── simpleServer.conf │ │ │ └── start.bit │ │ └── spyFilter │ │ │ ├── README.md │ │ │ └── spyFilter.c │ ├── cpp │ │ ├── cppHandler │ │ │ ├── appweb.conf │ │ │ ├── cppHandler.cpp │ │ │ ├── cppModule.def │ │ │ └── start.bit │ │ └── cppModule │ │ │ ├── README.md │ │ │ ├── cppModule.cpp │ │ │ ├── cppModule.def │ │ │ └── start.bit │ └── ejs │ │ ├── languageFeatures │ │ ├── array.js │ │ ├── autoinc.js │ │ ├── comment.js │ │ ├── constructor.js │ │ ├── features.ejs │ │ ├── float.js │ │ ├── for.js │ │ ├── foreach.js │ │ ├── function.js │ │ ├── if.js │ │ ├── inc.ejs │ │ ├── inc.js │ │ ├── method.js │ │ ├── null.js │ │ ├── object.js │ │ ├── parse.js │ │ ├── printVar.js │ │ ├── refCount.js │ │ ├── toString.js │ │ ├── trace.js │ │ └── var.js │ │ ├── postBack │ │ ├── features.ejs │ │ └── postBack.ejs │ │ ├── sessions │ │ └── sessions.ejs │ │ └── upload │ │ └── upload.ejs ├── server.c ├── server │ ├── appweb.c │ ├── appweb.conf │ ├── appweb.ico │ ├── appwebMonitor.h │ ├── groups.db │ ├── mime.types │ ├── php.ini │ ├── rom.files │ ├── romFiles.c │ ├── server.bit │ ├── users.db │ ├── web │ │ ├── favicon.ico │ │ ├── icons │ │ │ ├── back.gif │ │ │ ├── blank.gif │ │ │ ├── compressed.gif │ │ │ ├── folder.gif │ │ │ ├── parent.gif │ │ │ ├── space.gif │ │ │ └── text.gif │ │ ├── iehacks.css │ │ ├── images │ │ │ ├── banner.jpg │ │ │ ├── bottomShadow.jpg │ │ │ └── shadow.jpg │ │ ├── index.html │ │ ├── min-index.html │ │ ├── print.css │ │ ├── screen.css │ │ └── test │ │ │ ├── bench.html │ │ │ ├── test.cgi │ │ │ ├── test.ejs │ │ │ ├── test.esp │ │ │ ├── test.html │ │ │ ├── test.php │ │ │ ├── test.pl │ │ │ └── test.py │ └── windows │ │ ├── Makefile │ │ ├── admin.png │ │ ├── appweb.bmp │ │ ├── appweb.png │ │ ├── appweb.rc │ │ ├── appwebMonitor.c │ │ ├── appwebMonitor.ico │ │ ├── appwebMonitor.psd │ │ ├── appwebMonitor.rc │ │ ├── go.bmp │ │ ├── go.png │ │ ├── mon.ico │ │ ├── resource.h │ │ ├── stop.bmp │ │ ├── stop.png │ │ └── two.ico └── utils │ ├── authpass.c │ ├── cgiProgram.c │ ├── setConfig.c │ └── utils.bit └── test ├── api ├── c.tst ├── load.tst └── thread.tst ├── app ├── appweb.conf ├── cache │ └── .keep ├── controllers │ ├── cache.c │ ├── demo.c │ ├── post.c │ └── test.c ├── db │ └── test.mdb ├── layouts │ └── default.esp ├── static │ ├── images │ │ ├── banner.jpg │ │ ├── favicon.ico │ │ └── splash.jpg │ ├── index.esp │ ├── js │ │ ├── jquery.esp.js │ │ ├── jquery.js │ │ ├── jquery.simplemodal.js │ │ ├── jquery.tablesorter.js │ │ ├── jquery.treeview.js │ │ └── treeview.css │ ├── layout.css │ └── themes │ │ └── default.css └── views │ ├── post-edit.esp │ ├── post-list.esp │ ├── test-cmd-details.esp │ └── test-cmd-login.esp ├── appweb.conf ├── appweb.supp ├── auth.conf ├── auth ├── basic.tst ├── digest.tst └── post.tst ├── basic ├── alias.tst ├── callback.tst ├── cgi.tst ├── chunk.tst ├── dir.tst ├── ejs.tst ├── get.tst ├── header.tst ├── methods.tst ├── misc.tst ├── php.tst ├── post.tst ├── put.tst ├── query.tst ├── read.tst ├── redirect.tst ├── reuse.tst ├── secure.tst ├── stream.tst ├── test.dat ├── upload.tst └── vhost.tst ├── benchmark ├── http.tst └── test.setup ├── cache └── .keep ├── caching ├── api.tst ├── big.tst ├── client.tst ├── combined.tst ├── ext.tst ├── handlers.tst ├── limits.tst ├── manual.tst ├── methods.tst ├── only.tst ├── test.setup ├── types.tst └── unique.tst ├── cgi-bin └── .dummy ├── cmd ├── http.tst └── test.dat ├── compress └── gzip.tst ├── ejs ├── multiple.tst ├── session.tst ├── single.tst └── test.setup ├── error └── errordoc.tst ├── esp ├── alias.tst ├── big.tst ├── directives.tst ├── dump.tst ├── esp.new ├── get.tst ├── include.tst ├── mvc.tst ├── redirect.tst ├── reload.tst ├── session.tst ├── test.setup └── xname.tst ├── ipv6 ├── getv6.tst └── test.setup ├── lang ├── default.tst ├── root.tst ├── suffix.tst └── target.tst ├── leak ├── appweb.conf └── valgrind.tst ├── limits └── get.t ├── listing └── dirlist.tst ├── php.ini ├── range └── ranges.tst ├── redirect └── redirect.tst ├── regress ├── 01000-chunk.dat ├── 01000-chunk.tst └── tcp.c ├── route ├── auth.tst ├── cmd.tst ├── condition.tst ├── fullpat.tst ├── missing.tst ├── optional.tst ├── param.tst ├── token.tst └── var.tst ├── security ├── dos.tst └── huge-uri.tst ├── ssl ├── matrixssl.tst └── repeat.tst ├── sslconf ├── ca.crt ├── ca.key ├── ca.key.pem ├── openssl.ca ├── openssl.conf ├── response.client ├── response.server ├── response.yes ├── server.crt ├── server.key ├── server.key.pem └── start.bit ├── start.es ├── stress ├── badUrl.tst ├── bigForm.tst ├── bigUrl.tst ├── delay.tst ├── huge.tst ├── post.tst ├── test.setup ├── upload.tst └── whitespace.tst ├── test.bit ├── test.setup ├── testAppweb.c ├── testAppweb.h ├── testHttp.c ├── vxrun └── web ├── My Documents └── index.html ├── alias └── atest.html ├── alive.html ├── auth ├── basic │ ├── basic.esp │ ├── basic.html │ ├── basic.php │ ├── bug.ejs │ ├── executive │ │ └── executive.html │ └── joshua │ │ └── user.html ├── digest │ ├── digest.html │ ├── executive │ │ └── executive.html │ └── joshua │ │ └── user.html └── post │ ├── index.html │ ├── login-service.esp │ └── login.esp ├── bench └── bench.html ├── big.cgi ├── big.ejs ├── big.esp ├── big.php ├── big.txt ├── caching ├── cache.ejs ├── cache.esp ├── cache.php └── client.html ├── chinese.ejs ├── chinese2.ejs ├── compress └── compressed.txt.gz ├── dir └── index.html ├── directives.esp ├── dump.esp ├── dump.php ├── ejsProgram.ejs ├── empty.html ├── english └── eng.html ├── exit.esp ├── favicon.ico ├── form.ejs ├── form.esp ├── form.php ├── icons ├── back.gif ├── blank.gif ├── compressed.gif ├── folder.gif ├── parent.gif ├── space.gif └── text.gif ├── include.ejs ├── index.ejs ├── index.en.html ├── index.esp ├── index.fr.html ├── index.html ├── index.php ├── inner.esp ├── lines.txt ├── listing ├── test.dat ├── test_001.jpg ├── test_002.jpg └── test_003.jpg ├── main.html ├── nap.ejs ├── nap.esp ├── notFound.html ├── nph-test.cgi ├── numbers.html ├── numbers.txt ├── outer.ejs ├── outer.esp ├── redirect.esp ├── redirect.php ├── session.ejs ├── session.esp ├── simple.php ├── sleep.ejs ├── sleep.esp ├── sleep.php ├── slow.cgi ├── spin.php ├── sub ├── a.html ├── b.html └── sub1 │ └── c.html ├── test.cgi ├── test.dat ├── test.ejs ├── test.es ├── test.esp ├── test.html ├── test.php ├── test.pl ├── test.py ├── test.xesp ├── test.xml ├── upload.ejs ├── upload ├── php │ └── upload-via-php.php ├── upload-cgi.html ├── upload-esp.html ├── upload.ejs ├── upload.html ├── upload.php └── uploadComplete.html └── vhost ├── iphost └── private.html ├── namehost1 └── vhost1.html └── namehost2 └── vhost2.html /README.md: -------------------------------------------------------------------------------- 1 | Embedthis Appweb 4.X 2 | === 3 | 4 | The fast, little web server for embedded applications. 5 | 6 | Licensing 7 | --- 8 | See LICENSE.md for details. 9 | 10 | ### To Read Documentation: 11 | 12 | See http://appwebserver.org/products/appweb/doc/product/index.html 13 | 14 | ### Prerequisites: 15 | Ejscript (http://www.ejscript.org/downloads/ejs/download.ejs) for the Bit and Utest tools to configure and build. 16 | 17 | ### To Build: 18 | 19 | ./configure 20 | bit 21 | 22 | Alternatively to build without Ejscript: 23 | 24 | make 25 | 26 | Images are built into */bin. The build configuration is saved in */inc/bit.h. 27 | 28 | ### To Test: 29 | 30 | bit test 31 | 32 | ### To Run: 33 | 34 | bit run 35 | 36 | This will run appweb in the src/server directory using the src/server/appweb.conf configuration file. 37 | 38 | ### To Install: 39 | 40 | bit install 41 | 42 | ### To Create Packages: 43 | 44 | bit package 45 | 46 | Resources 47 | --- 48 | - [Appweb web site](http://appwebserver.org/) 49 | - [Embedthis web site](http://embedthis.com/) 50 | - [Appweb GitHub repository](http://github.com/embedthis/appweb-4) 51 | -------------------------------------------------------------------------------- /bits/packs/cgi.pak: -------------------------------------------------------------------------------- 1 | /* 2 | cgi.pak - CGI package for Bit 3 | */ 4 | 5 | pack('cgi', 'Common Gateway Interface Module') 6 | let cgi = probe('cgiHandler.c', {fullpath: true, search: [bit.dir.src.join('src/modules')]}) 7 | Bit.load({packs: { cgi: { path: cgi }}}) 8 | -------------------------------------------------------------------------------- /bits/packs/dir.pak: -------------------------------------------------------------------------------- 1 | /* 2 | dir.pak - DIR package for Bit 3 | */ 4 | 5 | pack('dir', 'Directory Listing Module') 6 | let dir = probe('dirHandler.c', {fullpath: true, search: [bit.dir.src.join('src')]}) 7 | Bit.load({packs: { dir: { path: dir }}}) 8 | -------------------------------------------------------------------------------- /bits/packs/esp.pak: -------------------------------------------------------------------------------- 1 | /* 2 | esp.pak - ESP package for Bit 3 | */ 4 | 5 | pack('esp', 'Embedded Server Pages Web Framework') 6 | let esp = probe('espHandler.c', {fullpath: true, search: [bit.dir.src.join('src/esp')]}) 7 | Bit.load({packs: { esp: { path: esp }}}) 8 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # configure -- Configure for building on Unix systems 4 | # 5 | # This simply invokes bit to do the work 6 | 7 | if ! type bit >/dev/null 2>&1 ; then 8 | echo "Install Ejscript for building" >&2 9 | exit 255 10 | fi 11 | bit configure $* 12 | -------------------------------------------------------------------------------- /doc/api/apiFooter.tem: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |

© Embedthis Software LLC, 2003-2012. All rights 7 | reserved. Embedthis, Ejscript and Appweb are trademarks of Embedthis Software LLC.

8 |
9 | 10 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/api/esp.dtags: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /doc/api/espBare.html: -------------------------------------------------------------------------------- 1 |

APPWEB - ESP API Native API

2 |

Components

3 | 4 |
5 |

Functions

6 | 7 |
8 |

Typedefs

9 | 10 |
11 |

Defines

12 | 13 |
14 |

Functions

15 |

Typedefs

16 | -------------------------------------------------------------------------------- /doc/dsi/bottom.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | © Embedthis Software LLC, 2003-2012. 4 | All rights reserved. Embedthis, ESP, Ejscript and Appweb are trademarks of Embedthis Software LLC. 5 |

6 |
7 | 8 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/dsi/espSeeAlso.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 14 | -------------------------------------------------------------------------------- /doc/dsi/genSeeAlso.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 15 | -------------------------------------------------------------------------------- /doc/dsi/gettingSeeAlso.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 18 | -------------------------------------------------------------------------------- /doc/dsi/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Embedthis Appweb 4.1.0 Documentation 5 | 7 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 |
20 | 21 |
22 | 26 |
27 |
28 | Home 29 | -------------------------------------------------------------------------------- /doc/dsi/progGuideSeeAlso.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 16 | -------------------------------------------------------------------------------- /doc/dsi/see.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 6 | -------------------------------------------------------------------------------- /doc/dsi/sourceSeeAlso.html: -------------------------------------------------------------------------------- 1 |

See Also

2 | 19 | -------------------------------------------------------------------------------- /doc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/favicon.ico -------------------------------------------------------------------------------- /doc/iehacks.css: -------------------------------------------------------------------------------- 1 | *div.contentLeft { 2 | float: left; 3 | } 4 | -------------------------------------------------------------------------------- /doc/images/appweb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/appweb.bmp -------------------------------------------------------------------------------- /doc/images/appweb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/appweb.ico -------------------------------------------------------------------------------- /doc/images/appwebArchitecture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/appwebArchitecture.gif -------------------------------------------------------------------------------- /doc/images/banner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/banner.gif -------------------------------------------------------------------------------- /doc/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/banner.jpg -------------------------------------------------------------------------------- /doc/images/banner.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/banner.psd -------------------------------------------------------------------------------- /doc/images/bannerClouds.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/bannerClouds.jpg -------------------------------------------------------------------------------- /doc/images/board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/board.jpg -------------------------------------------------------------------------------- /doc/images/bottomShadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/bottomShadow.jpg -------------------------------------------------------------------------------- /doc/images/bottomShadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/bottomShadow.png -------------------------------------------------------------------------------- /doc/images/caching/caching-steps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/caching/caching-steps.jpg -------------------------------------------------------------------------------- /doc/images/ejsArchitecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/ejsArchitecture.jpg -------------------------------------------------------------------------------- /doc/images/ejsWebView.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/ejsWebView.jpg -------------------------------------------------------------------------------- /doc/images/esp/template/compile.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/template/compile.jpeg -------------------------------------------------------------------------------- /doc/images/esp/template/layout.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/template/layout.jpeg -------------------------------------------------------------------------------- /doc/images/esp/tour/count10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/count10.png -------------------------------------------------------------------------------- /doc/images/esp/tour/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/create.png -------------------------------------------------------------------------------- /doc/images/esp/tour/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/error.png -------------------------------------------------------------------------------- /doc/images/esp/tour/hello-dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/hello-dynamic.png -------------------------------------------------------------------------------- /doc/images/esp/tour/hello-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/hello-layout.png -------------------------------------------------------------------------------- /doc/images/esp/tour/hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/hello.png -------------------------------------------------------------------------------- /doc/images/esp/tour/home-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/home-link.png -------------------------------------------------------------------------------- /doc/images/esp/tour/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/home.png -------------------------------------------------------------------------------- /doc/images/esp/tour/post-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/post-list.png -------------------------------------------------------------------------------- /doc/images/esp/tour/tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/tabs.png -------------------------------------------------------------------------------- /doc/images/esp/tour/validate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/esp/tour/validate.png -------------------------------------------------------------------------------- /doc/images/espArchitecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/espArchitecture.jpg -------------------------------------------------------------------------------- /doc/images/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/form.png -------------------------------------------------------------------------------- /doc/images/jquery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/jquery.gif -------------------------------------------------------------------------------- /doc/images/modules.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/modules.jpg -------------------------------------------------------------------------------- /doc/images/mvc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/mvc.jpg -------------------------------------------------------------------------------- /doc/images/nslu2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/nslu2.jpg -------------------------------------------------------------------------------- /doc/images/pipeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/pipeline.jpg -------------------------------------------------------------------------------- /doc/images/pixel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/pixel.gif -------------------------------------------------------------------------------- /doc/images/proxied.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/proxied.jpg -------------------------------------------------------------------------------- /doc/images/routeSteps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/routeSteps.jpg -------------------------------------------------------------------------------- /doc/images/routing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/routing.jpg -------------------------------------------------------------------------------- /doc/images/scalable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/scalable.jpg -------------------------------------------------------------------------------- /doc/images/services.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/services.jpg -------------------------------------------------------------------------------- /doc/images/shadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/shadow.jpg -------------------------------------------------------------------------------- /doc/images/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/shadow.png -------------------------------------------------------------------------------- /doc/images/tray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/images/tray.jpg -------------------------------------------------------------------------------- /doc/man/appwebMonitor.1: -------------------------------------------------------------------------------- 1 | .TH APPWEBMONITOR "1" "March 2012" "appwebMonitor" "User Commands" 2 | .SH NAME 3 | appwebMonitor - Appweb Monitor Program for Windows 4 | .SH SYNOPSIS 5 | .B appwebMonitor 6 | [\fI--manage\fR] 7 | [\fI--stop\fR] 8 | .SH DESCRIPTION 9 | The appwebMonitor program runs in the Windows tray and provides visual feedback and control over the Appweb and Appweb 10 | manager process. Right-click to display the Monitor menu. From this menu, you can start or stop Appweb and launch 11 | the management console. Double-click will launch a browser homed to the web server home page. 12 | .SH OPTIONS 13 | .TP 14 | \fB\--manage\fR 15 | Launch a browser to display the Appweb management console. This is currently not implemented. 16 | .TP 17 | \fB\--stop\fR 18 | Stop the currently executing Monitor program. 19 | .SH "REPORTING BUGS" 20 | Report bugs to . 21 | .SH COPYRIGHT 22 | Copyright \(co 2003-2012 Embedthis Software. 23 | .br 24 | .SH "SEE ALSO" 25 | appweb 26 | -------------------------------------------------------------------------------- /doc/man/appwebMonitor.html: -------------------------------------------------------------------------------- 1 |
 2 | APPWEBMONITOR(1)                 User Commands                APPWEBMONITOR(1)
 3 | 
 4 | NAME
 5 |        appwebMonitor - Appweb Monitor Program for Windows
 6 | 
 7 | SYNOPSIS
 8 |        appwebMonitor [--manage] [--stop]
 9 | 
10 | DESCRIPTION
11 |        The  appwebMonitor program runs in the Windows tray and provides visual
12 |        feedback and control over the Appweb and Appweb manager process. Right-
13 |        click  to  display  the  Monitor menu. From this menu, you can start or
14 |        stop Appweb and launch the management console. Double-click will launch
15 |        a browser homed to the web server home page.
16 | 
17 | OPTIONS
18 |        --manage
19 |               Launch  a browser to display the Appweb management console. This
20 |               is currently not implemented.
21 | 
22 |        --stop Stop the currently executing Monitor program.
23 | 
24 | REPORTING BUGS
25 |        Report bugs to <dev@embedthis.com>.
26 | 
27 | COPYRIGHT
28 |        Copyright (C) 2003-2012 Embedthis Software.
29 | 
30 | SEE ALSO
31 |        appweb
32 | 
33 | appwebMonitor                     March 2012                  APPWEBMONITOR(1)
34 | 
35 | -------------------------------------------------------------------------------- /doc/man/appwebMonitor.txt: -------------------------------------------------------------------------------- 1 | APPWEBMONITOR(1) User Commands APPWEBMONITOR(1) 2 | 3 | 4 | 5 | NAME 6 | appwebMonitor - Appweb Monitor Program for Windows 7 | 8 | SYNOPSIS 9 | appwebMonitor [--manage] [--stop] 10 | 11 | DESCRIPTION 12 | The appwebMonitor program runs in the Windows tray and provides visual 13 | feedback and control over the Appweb and Appweb manager process. Right- 14 | click to display the Monitor menu. From this menu, you can start or 15 | stop Appweb and launch the management console. Double-click will launch 16 | a browser homed to the web server home page. 17 | 18 | OPTIONS 19 | --manage 20 | Launch a browser to display the Appweb management console. This 21 | is currently not implemented. 22 | 23 | --stop Stop the currently executing Monitor program. 24 | 25 | REPORTING BUGS 26 | Report bugs to . 27 | 28 | COPYRIGHT 29 | Copyright (C) 2003-2012 Embedthis Software. 30 | 31 | SEE ALSO 32 | appweb 33 | 34 | 35 | 36 | appwebMonitor March 2012 APPWEBMONITOR(1) 37 | -------------------------------------------------------------------------------- /doc/man/authpass.1: -------------------------------------------------------------------------------- 1 | .TH AUTH "1" "February 2012" "auth" "User Commands" 2 | .SH NAME 3 | authpass \- Create and manage passwords 4 | .SH SYNOPSIS 5 | .B authpass [\fI-c\fR] 6 | [\fI-p password\fR] 7 | passwordFile realm userName 8 | .SH OPTIONS 9 | .TP 10 | \fB\-p password\fR 11 | Specifies a password to use to for the user. 12 | .TP 13 | \fB\-c\fR 14 | Create the specified password file 15 | .PP 16 | .SH DESCRIPTION 17 | The authpass program is used to create user passwords in a nominated password configuration file. 18 | Appweb uses the same authorization file andeformat for Basic, Digest and Post authentication stores. This simplifies administration. 19 | .SH "REPORTING BUGS" 20 | Report bugs to . 21 | .SH COPYRIGHT 22 | Copyright \(co 2003-2012 Embedthis Software. 23 | .br 24 | .SH "SEE ALSO" 25 | -------------------------------------------------------------------------------- /doc/man/authpass.html: -------------------------------------------------------------------------------- 1 |
 2 | AUTH(1)                          User Commands                         AUTH(1)
 3 | 
 4 | NAME
 5 |        authpass - Create and manage passwords
 6 | 
 7 | SYNOPSIS
 8 |        authpass [-c] [-p password] passwordFile realm userName
 9 | 
10 | OPTIONS
11 |        -p password
12 |               Specifies a password to use to for the user.
13 | 
14 |        -c     Create the specified password file
15 | 
16 | DESCRIPTION
17 |        The  authpass  program  is used to create user passwords in a nominated
18 |        password configuration file.  Appweb uses the same  authorization  file
19 |        andeformat  for Basic, Digest and Post authentication stores. This sim-
20 |        plifies administration.
21 | 
22 | REPORTING BUGS
23 |        Report bugs to <dev@embedthis.com>.
24 | 
25 | COPYRIGHT
26 |        Copyright (C) 2003-2012 Embedthis Software.
27 | 
28 | SEE ALSO
29 | auth                             February 2012                         AUTH(1)
30 | 
31 | -------------------------------------------------------------------------------- /doc/man/authpass.txt: -------------------------------------------------------------------------------- 1 | AUTH(1) User Commands AUTH(1) 2 | 3 | 4 | 5 | NAME 6 | authpass - Create and manage passwords 7 | 8 | SYNOPSIS 9 | authpass [-c] [-p password] passwordFile realm userName 10 | 11 | OPTIONS 12 | -p password 13 | Specifies a password to use to for the user. 14 | 15 | -c Create the specified password file 16 | 17 | 18 | DESCRIPTION 19 | The authpass program is used to create user passwords in a nominated 20 | password configuration file. Appweb uses the same authorization file 21 | andeformat for Basic, Digest and Post authentication stores. This sim- 22 | plifies administration. 23 | 24 | REPORTING BUGS 25 | Report bugs to . 26 | 27 | COPYRIGHT 28 | Copyright (C) 2003-2012 Embedthis Software. 29 | 30 | SEE ALSO 31 | auth February 2012 AUTH(1) 32 | -------------------------------------------------------------------------------- /doc/masters/caching/caching-steps.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/caching/caching-steps.pptx -------------------------------------------------------------------------------- /doc/masters/esp/espArchitecture.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/esp/espArchitecture.pptx -------------------------------------------------------------------------------- /doc/masters/modules.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/modules.pptx -------------------------------------------------------------------------------- /doc/masters/monitor.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/monitor.pptx -------------------------------------------------------------------------------- /doc/masters/old/appwebArchitecture.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/old/appwebArchitecture.ppt -------------------------------------------------------------------------------- /doc/masters/old/routing.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/old/routing.pxm -------------------------------------------------------------------------------- /doc/masters/pipeline.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/pipeline.pptx -------------------------------------------------------------------------------- /doc/masters/proxied.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/proxied.pptx -------------------------------------------------------------------------------- /doc/masters/routing/routeSteps.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/routing/routeSteps.pptx -------------------------------------------------------------------------------- /doc/masters/routing/routing.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/routing/routing.pptx -------------------------------------------------------------------------------- /doc/masters/scalable.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/scalable.pptx -------------------------------------------------------------------------------- /doc/masters/template/compile.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/template/compile.pptx -------------------------------------------------------------------------------- /doc/masters/template/layout.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/doc/masters/template/layout.pptx -------------------------------------------------------------------------------- /doc/print.css: -------------------------------------------------------------------------------- 1 | pre { 2 | font-size: 110%; 3 | line-height: 140%; 4 | font-family: Consolas, Monaco, Courier, Courier New, Courier, monospace; 5 | padding: 10px 15px 10px 15px; 6 | margin: 16px 0 20px 0; 7 | background-color: #EEEEFF; 8 | color: #000000; 9 | border: 1px solid #444455; 10 | } 11 | 12 | pre b { 13 | color: #000; 14 | font-weight: bold; 15 | } 16 | -------------------------------------------------------------------------------- /doc/product/changelog: -------------------------------------------------------------------------------- 1 | appweb (4.0.0) edgy; urgency=low 2 | 3 | * See changeLog.html for a full changelog. 4 | 5 | -- Michael O'Brien Wed, 21 Jan 2009 20:37:44 +0800 6 | -------------------------------------------------------------------------------- /doc/product/version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 |

4.1.0

25 | 26 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /doc/tidy.conf: -------------------------------------------------------------------------------- 1 | tidy-mark: no 2 | write-back: yes 3 | wrap: 125 4 | indent: auto 5 | indent-spaces: 4 6 | tab-size: 4 7 | markup: yes 8 | quote-ampersand: yes 9 | quote-nbsp: yes 10 | wrap-attributes: yes 11 | output-xhtml: yes 12 | doctype: auto 13 | clean: no 14 | enclose-block-text: no 15 | break-before-br: no 16 | vertical-space: no 17 | escape-cdata: yes 18 | -------------------------------------------------------------------------------- /package/Makefile-flat: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile -- Build It Makefile to build Embedthis Appweb for macosx on x86_64 3 | # 4 | 5 | CFLAGS := -g -w 6 | LDFLAGS := -L. -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/ -Wl,-rpath,@loader_path/ 7 | LIBS := -lpthread -lm -ldl -lpam 8 | 9 | all: libappweb.dylib appweb 10 | 11 | libappweb.dylib: appwebLib.o deps.o pcre.o sqlite3.o 12 | cc -o libappweb.dylib -dynamiclib $(CFLAGS) $(DFLAGS) $(LDFLAGS) appwebLib.o deps.o pcre.o sqlite3.o $(LIBS) 13 | 14 | appweb: libappweb.dylib 15 | cc -o appweb $(LDFLAGS) appweb.c -lappweb $(LIBS) 16 | 17 | clean: 18 | rm appweb libappweb.dylib *.o 19 | rm -fr *.dSYM 20 | -------------------------------------------------------------------------------- /package/linux/appweb.openwrt: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # 3 | # Startup script for Embedthis Appweb 4 | # Copyright (c) Embedthis LLC, 2003-2012. All Rights Reserved. 5 | # 6 | START=50 7 | STOP=50 8 | APPWEB_CMD=${prefixes.bin}/${settings.product} 9 | APPWEB_DIR=${prefixes.cfg} 10 | 11 | start() { 12 | start-stop-daemon -S -b -x "${APPWEB_CMD}" -- --home "$APPWEB_DIR" 13 | } 14 | 15 | stop() { 16 | start-stop-daemon -K -x "${APPWEB_CMD}" >/dev/null 2>&1 ; true 17 | } 18 | -------------------------------------------------------------------------------- /package/linux/appweb.upstart: -------------------------------------------------------------------------------- 1 | # 2 | # appweb - Embedded web server 3 | # 4 | 5 | description "Embedthis Appweb" 6 | 7 | start on runlevel [2345] 8 | stop on runlevel [!2345] 9 | 10 | respawn 11 | exec /usr/lib/appweb/bin/appweb --home /etc/appweb 12 | 13 | -------------------------------------------------------------------------------- /package/linux/deb.bin/conffiles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/package/linux/deb.bin/conffiles -------------------------------------------------------------------------------- /package/linux/deb.bin/control: -------------------------------------------------------------------------------- 1 | Package: ${settings.product} 2 | Version: ${settings.version} 3 | Section: web 4 | Priority: optional 5 | Architecture: ${platform.mappedCpu} 6 | Depends: libc6 7 | Provides: appweb 8 | Replaces: appweb, appweb-dev, appweb-bin 9 | Conflicts: appweb, appweb-dev, appweb-bin 10 | Installed-Size: 10 11 | Maintainer: Embedthis Development 12 | Description: Embedthis Appweb Web Server 13 | Appweb is a compact and powerful web server suitable for dynamic web applications. 14 | . 15 | more information about Appweb can be found at: 16 | 17 | 18 | -------------------------------------------------------------------------------- /package/linux/deb.bin/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # prerm -- Pre removal script for appweb 4 | # 5 | # Copyright (c) Embedthis Software LLC, 2003-2012. All Rights Reserved. 6 | # 7 | 8 | BIT_PRODUCT=${settings.product} 9 | BIT_NAME="${settings.title}" 10 | BIT_CFG_PREFIX="${prefixes.config}" 11 | 12 | ############################################################################### 13 | # 14 | # Main 15 | # 16 | cd / 17 | action=$1 18 | case $action in 19 | remove) # when new 20 | # or conflictor's prerm remove in-favor package new-version 21 | oldVersion=$2 22 | appman stop >/dev/null 2>&1 ; true 23 | appman disable >/dev/null 2>&1 ; true 24 | appman uninstall >/dev/null 2>&1 ; true 25 | pid=`/bin/pidof ${prefixes.bin}/$BIT_PRODUCT; true` 26 | [ "$pid" != "" ] && kill -9 $pid 27 | rm -rf /var/lock/subsys/$BIT_PRODUCT /var/lock/$BIT_PRODUCT /var/log/$BIT_PRODUCT /var/run/$BIT_PRODUCT 28 | ;; 29 | upgrade) # when old 30 | newVersion=$2 31 | appman uninstall 32 | ;; 33 | failed-upgrade) # when new 34 | oldVersion=$2 35 | ;; 36 | deconfigure) # when old 37 | # deconfigure in-favor package-being-installed version removing 38 | # conflicting-package version 39 | esac 40 | exit 0 41 | -------------------------------------------------------------------------------- /package/macosx/appweb.pmdoc/01contents.xml: -------------------------------------------------------------------------------- 1 | com.embedthis.appweb.contents.pkg1.0${settings.product}-${settings.version}-${settings.buildNumber}/contents/installToscripts.scriptsDirectoryPath.pathscripts.postflight.pathscripts.postflight.isRelativeTypescripts.scriptsDirectoryPath.isRelativeTypeparentinstallFrom.isRelativeTypescripts/postflightscripts01contents-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ 2 | -------------------------------------------------------------------------------- /package/macosx/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/package/macosx/background.png -------------------------------------------------------------------------------- /package/macosx/com.embedthis.appweb.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.embedthis.appweb 7 | KeepAlive 8 | 9 | WorkingDirectory 10 | /etc/appweb 11 | RunAtLoad 12 | 13 | ProgramArguments 14 | 15 | /usr/local/bin/appweb 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /package/macosx/scripts/preflight: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # preflight -- Pre flight script for binary install 4 | # 5 | # Copyright (c) Embedthis Software LLC, 2003-2012. All Rights Reserved. 6 | # 7 | ############################################################################### 8 | 9 | echo @@@@@ preflight 10 | set -x 11 | 12 | removeOld() { 13 | prefix="/usr/lib/appweb" 14 | version= 15 | for v in `ls $prefix 2>/dev/null | egrep -v '[a-zA-Z@!_\-]' | sort -n -r` 16 | do 17 | if [ -x "$prefix/$v/bin/appweb" ] ; then 18 | version=$v 19 | break 20 | fi 21 | done 22 | if [ -x /usr/lib/appweb/$version/bin/uninstall ] ; then 23 | HEADLESS=1 /usr/lib/appweb/$version/bin/uninstall &1 >/dev/null 24 | fi 25 | } 26 | 27 | ############################################################################### 28 | # 29 | # Main 30 | # 31 | 32 | removeOld 33 | exit 0 34 | -------------------------------------------------------------------------------- /package/package.bit: -------------------------------------------------------------------------------- 1 | /* 2 | package.bit 3 | */ 4 | 5 | Bit.load({ 6 | targets: { 7 | removeFiles: { 8 | enable: bit.platform.like == 'windows', 9 | type: 'exe', 10 | rule: 'gui' 11 | sources: [ 'windows/removeFiles.c' ], 12 | depends: [ 'libmpr' ], 13 | platforms: [ 'local' ], 14 | }, 15 | }, 16 | }) 17 | -------------------------------------------------------------------------------- /package/windows/unattended.ans: -------------------------------------------------------------------------------- 1 | [Setup] 2 | Lang=default 3 | Group=Embedthis Appweb 4 | NoIcons=0 5 | Components=bin,doc,dev 6 | -------------------------------------------------------------------------------- /projects/appweb-windows/debug.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vsdebug 6 | 7 | 8 | 9 | _DEBUG;BIT_DEBUG;DEBUG_IDE;%(PreprocessorDefinitions) 10 | Disabled 11 | EnableFastChecks 12 | MultiThreadedDebugDLL 13 | 14 | 15 | true 16 | 17 | 18 | 19 | 20 | $(Cfg) 21 | true 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /projects/appweb-windows/libappweb.def: -------------------------------------------------------------------------------- 1 | LIBRARY libappweb.dll 2 | EXPORTS 3 | maAddDirective 4 | maAddEndpoint 5 | maAddServer 6 | maApplyChangedGroup 7 | maApplyChangedUser 8 | maConfigureServer 9 | maCreateAppweb 10 | maCreateServer 11 | maGetDefaultAuth 12 | maGetUserGroup 13 | maLoadModule 14 | maLogRequest 15 | maLookupServer 16 | maOpenConfig 17 | maOpenDirHandler 18 | maOpenFileHandler 19 | maParseConfig 20 | maParseInit 21 | maParsePlatform 22 | maPopState 23 | maPushState 24 | maRemoveEndpoint 25 | maRenderDirListing 26 | maRestartServer 27 | maRunSimpleWebServer 28 | maRunWebServer 29 | maSetDefaultServer 30 | maSetHttpGroup 31 | maSetHttpUser 32 | maSetPlatform 33 | maSetServerAddress 34 | maSetServerHome 35 | maStartAppweb 36 | maStartServer 37 | maStopAppweb 38 | maStopServer 39 | maTokenize 40 | maValidateServer 41 | maWriteAccessLogEntry 42 | maWriteAuthFile 43 | -------------------------------------------------------------------------------- /projects/appweb-windows/libmprssl.def: -------------------------------------------------------------------------------- 1 | LIBRARY libmprssl.dll 2 | EXPORTS 3 | mprCreateMatrixSslModule 4 | mprCreateOpenSslModule 5 | mprSslInit 6 | -------------------------------------------------------------------------------- /projects/appweb-windows/libpcre.def: -------------------------------------------------------------------------------- 1 | LIBRARY libpcre.dll 2 | EXPORTS 3 | _pcre_OP_lengths 4 | _pcre_default_tables 5 | _pcre_is_newline 6 | _pcre_ord2utf8 7 | _pcre_try_flipped 8 | _pcre_ucp_findprop 9 | _pcre_ucp_othercase 10 | _pcre_utf8_table1 11 | _pcre_utf8_table1_size 12 | _pcre_utf8_table2 13 | _pcre_utf8_table3 14 | _pcre_utf8_table4 15 | _pcre_utt 16 | _pcre_utt_names 17 | _pcre_utt_size 18 | _pcre_valid_utf8 19 | _pcre_was_newline 20 | _pcre_xclass 21 | pcre_callout 22 | pcre_compile 23 | pcre_compile2 24 | pcre_exec 25 | pcre_free 26 | pcre_malloc 27 | pcre_stack_free 28 | pcre_stack_malloc 29 | -------------------------------------------------------------------------------- /projects/appweb-windows/mod_cgi.def: -------------------------------------------------------------------------------- 1 | LIBRARY mod_cgi.dll 2 | EXPORTS 3 | maCgiHandlerInit 4 | -------------------------------------------------------------------------------- /projects/appweb-windows/mod_php.def: -------------------------------------------------------------------------------- 1 | LIBRARY mod_php.dll 2 | EXPORTS 3 | maPhpHandlerInit -------------------------------------------------------------------------------- /projects/appweb-windows/mod_ssl.def: -------------------------------------------------------------------------------- 1 | LIBRARY mod_ssl.dll 2 | EXPORTS 3 | maSslModuleInit -------------------------------------------------------------------------------- /projects/appweb-windows/php5ts.dll.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | php_pcre_compile 3 | php_pcre_copy_substring 4 | php_pcre_exec 5 | php_pcre_get_substring 6 | php_pcre_get_substring_list 7 | php_pcre_info 8 | php_pcre_maketables 9 | php_pcre_study 10 | php_pcre_version 11 | php_pcre_fullinfo 12 | php_pcre_free 13 | -------------------------------------------------------------------------------- /projects/appweb-windows/product.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(IncDir);%(AdditionalIncludeDirectories) 7 | WIN32;_WINDOWS;_REENTRANT;_MT;%(PreprocessorDefinitions) 8 | 9 | 10 | ws2_32.lib;%(AdditionalDependencies) 11 | $(OutDir);%(AdditionalLibraryDirectories) 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/appweb-windows/release.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vsrelease 6 | 7 | 8 | 9 | MinSpace 10 | MultiThreadedDLL 11 | true 12 | true 13 | 14 | 15 | false 16 | 17 | 18 | 19 | 20 | $(Cfg) 21 | true 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /projects/appweb-windows/x64.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ..\..\windows-x64-$(Cfg) 6 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\inc)) 7 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\obj)) 8 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\bin)) 9 | 10 | 11 | 12 | $(CfgDir) 13 | true 14 | 15 | 16 | $(BinDir) 17 | true 18 | 19 | 20 | $(IncDir) 21 | true 22 | 23 | 24 | $(ObjDir) 25 | true 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /projects/appweb-windows/x86.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ..\..\windows-x86-$(Cfg) 6 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\inc)) 7 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\obj)) 8 | $([System.IO.Path]::GetFullPath($(ProjectDir)\$(CfgDir)\bin)) 9 | 10 | 11 | 12 | $(CfgDir) 13 | true 14 | 15 | 16 | $(BinDir) 17 | true 18 | 19 | 20 | $(IncDir) 21 | true 22 | 23 | 24 | $(ObjDir) 25 | true 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /projects/idebuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # idebuild -- Build a project using the native IDE 4 | # 5 | 6 | PRODUCT=appweb 7 | VS="${PROGRAMFILES}/Microsoft Visual Studio 10.0/Common7/IDE/devenv.exe" 8 | XCODE=/usr/bin/xcodebuild 9 | 10 | log() { 11 | tag=$1 12 | shift 13 | printf "%12s %s\n" $tag "$*" 14 | } 15 | 16 | if [ -x "${VS}" ] ; then 17 | log "[Test]" "Building ${PRODUCT} Visual Studio Project" 18 | "${VS}" projects/*.sln /clean 19 | "${VS}" projects/*.sln /build 20 | fi 21 | 22 | if [ -x "${XCODE}" ] ; then 23 | log "[Test]" "Building ${PRODUCT} Xcode Project" 24 | "${XCODE}" -project projects/*.xcodeproj -alltargets clean 25 | "${XCODE}" -project projects/*.xcodeproj -alltargets build 26 | fi 27 | -------------------------------------------------------------------------------- /projects/windows.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Set VS vars and invoke nmake 4 | REM 5 | 6 | if NOT DEFINED VSINSTALLDIR call "%PROGRAMFILES%/Microsoft Visual Studio 11.0/VC/vcvarsall.bat" %1 7 | if NOT DEFINED VSINSTALLDIR call "%PROGRAMFILES%/Microsoft Visual Studio 10.0/VC/vcvarsall.bat" %1 8 | if NOT DEFINED VSINSTALLDIR call "%PROGRAMFILES%/Microsoft Visual Studio 9.0/VC/vcvarsall.bat" %1 9 | 10 | echo nmake %2 %3 %4 %5 %6 %7 %8 %9 11 | nmake %2 %3 %4 %5 %6 %7 %8 %9 12 | -------------------------------------------------------------------------------- /src/customize.h: -------------------------------------------------------------------------------- 1 | /* 2 | customize.h -- Place to override standard product defintions 3 | */ 4 | 5 | #ifndef _h_CUSTOMIZE_h 6 | #define _h_CUSTOMIZE_h 1 7 | 8 | /* 9 | Override definitions here. This file is included after all other headers are parsed. 10 | 11 | Use this to override the default appweb.conf file 12 | #define BIT_CONFIG_FILE "/path/to/default/appweb.conf" 13 | 14 | Use this to override the default server root directory 15 | #define BIT_SERVER_ROOT "/var/spool/chroot/jail" 16 | 17 | Use this to override the path to the appweb executable 18 | #define BIT_APPWEB_PATH "/path/to/appweb" 19 | */ 20 | 21 | /* 22 | If you require function name remapping in ESP, do so here. Change the "xx_" to any 23 | unique prefix you require. Then use that name in ESP pages and controllers. 24 | 25 | #define script xx_script 26 | */ 27 | #endif /* _h_CUSTOMIZE_h */ 28 | -------------------------------------------------------------------------------- /src/deps/http/http.bit: -------------------------------------------------------------------------------- 1 | /* 2 | http.bit -- Bit File for Http 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | libhttp: { 9 | type: 'lib', 10 | sources: [ 'httpLib.c' ], 11 | headers: [ '*.h' ], 12 | depends: [ 'libmpr', 'libpcre', ], 13 | scripts: { 14 | postblend: " 15 | if (bit.settings.hasPam) { 16 | bit.target.libraries.push('pam') 17 | } 18 | ", 19 | }, 20 | }, 21 | 22 | http: { 23 | type: 'exe', 24 | sources: [ 'http.c' ], 25 | depends: [ 'libhttp', ], 26 | platforms: [ 'local' ], 27 | }, 28 | }, 29 | }) 30 | -------------------------------------------------------------------------------- /src/deps/mpr/mpr.bit: -------------------------------------------------------------------------------- 1 | /* 2 | mpr.bit -- Bit File to build the combo MPR release 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | libmpr: { 9 | type: 'lib', 10 | sources: [ 'mprLib.c' ], 11 | headers: [ '*.h' ], 12 | }, 13 | 14 | libmprssl: { 15 | type: 'lib', 16 | depends: [ 'libmpr', 'openssl', 'matrixssl' ], 17 | sources: [ 'mprSsl.c' ], 18 | }, 19 | 20 | manager: { 21 | enable: 'bit.settings.manager', 22 | type: 'exe', 23 | path: '${BIN}/${settings.manager}${EXE}' 24 | rule: 'gui', 25 | depends: [ 'libmpr' ], 26 | sources: [ 'manager.c' ], 27 | scripts: { prebuild: "bit.settings.manager ||= 'manager'" }, 28 | }, 29 | 30 | makerom: { 31 | type: 'exe', 32 | depends: [ 'libmpr', ], 33 | sources: ['makerom.c'], 34 | platforms: [ 'local' ], 35 | }, 36 | }, 37 | }) 38 | -------------------------------------------------------------------------------- /src/deps/pcre/pcre.bit: -------------------------------------------------------------------------------- 1 | /* 2 | pcre.bit -- Bit File for the PCRE Regular Expressions 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | libpcre: { 9 | scripts: { 10 | prebuild: " 11 | if (bit.settings.charlen == 2) { 12 | bit.target.defines = [ '-DPCRE_CHAR=short' ] 13 | } else if (bit.settings.charlen == 4) { 14 | bit.target.defines = [ '-DPCRE_CHAR=int32' ] 15 | } else { 16 | bit.target.defines = [ '-DPCRE_CHAR=char' ] 17 | } 18 | ", 19 | } 20 | type: 'lib', 21 | headers: [ '*.h' ], 22 | sources: [ 'pcre.c' ], 23 | }, 24 | }, 25 | }) 26 | -------------------------------------------------------------------------------- /src/deps/sqlite/sqlite.bit: -------------------------------------------------------------------------------- 1 | /* 2 | sqlite.bit -- Bit File for SQLite 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | libsqlite3: { 9 | type: 'lib', 10 | headers: [ '*.h' ], 11 | sources: [ 'sqlite3.c' ], 12 | '-compiler': [ 13 | '-Wall', 14 | '-Wshorten-64-to-32', 15 | ], 16 | scripts: { 17 | '+precompile': " 18 | if (bit.packs.compiler.path.basename == 'gcc') { 19 | bit.target.compiler.push('-w') 20 | } else if (bit.packs.compiler.path.basename == 'clang') { 21 | bit.target.compiler.push('-w') 22 | } 23 | ", 24 | }, 25 | }, 26 | sqlite: { 27 | type: 'exe' 28 | sources: ['sqlite.c'], 29 | depends: ['libsqlite3'], 30 | platforms: [ 'local' ], 31 | }, 32 | }, 33 | }) 34 | -------------------------------------------------------------------------------- /src/esp/esp-app.h: -------------------------------------------------------------------------------- 1 | /* 2 | esp-app.h -- ESP Application header 3 | 4 | This file should be located in the DocumentRoot for a Route. 5 | All ESP requests using that Route will source this header. 6 | */ 7 | 8 | #ifndef _h_ESP_APP 9 | #define _h_ESP_APP 1 10 | 11 | #include "esp.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* 18 | Put your definitions here 19 | 20 | If you need to remap an abbreviated API name that clashes with an API name of yours, 21 | you can rename the ESP APIs here. Change the "xx_" to any unique prefix you require. 22 | Then use that name in ESP pages and controllers. 23 | 24 | #define table xx_table 25 | */ 26 | 27 | #ifdef __cplusplus 28 | } /* extern C */ 29 | #endif 30 | #endif /* _h_ESP_APP */ 31 | -------------------------------------------------------------------------------- /src/esp/www-future/files/static/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/images/banner.jpg -------------------------------------------------------------------------------- /src/esp/www-future/files/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/images/favicon.ico -------------------------------------------------------------------------------- /src/esp/www-future/files/static/images/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/images/splash.jpg -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/file.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/folder-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/folder-closed.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/folder.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/minus.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/plus.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-black-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-black-line.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-black.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-default-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-default-line.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-default.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-famfamfam-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-famfamfam-line.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-famfamfam.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-famfamfam.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-gray-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-gray-line.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-gray.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-red-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-red-line.gif -------------------------------------------------------------------------------- /src/esp/www-future/files/static/js/tree-images/treeview-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www-future/files/static/js/tree-images/treeview-red.gif -------------------------------------------------------------------------------- /src/esp/www/files/layouts/default.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% securityToken(); %> 6 | <% icon(0, 0); %> 7 | <% stylesheet(0, 0); %> 8 | <% script(0, 0); %> 9 | ${TITLE} Application 10 | 11 | 12 | 13 |
14 |

<% label("${TITLE} Application", "{data-click: '~'}"); %>

15 |
16 | 17 | <% flash("all", NULL); %> 18 |
19 | <%@ content %> 20 |
21 |
22 |

Powered by Appweb ESP™

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /src/esp/www/files/static/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www/files/static/images/banner.jpg -------------------------------------------------------------------------------- /src/esp/www/files/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www/files/static/images/favicon.ico -------------------------------------------------------------------------------- /src/esp/www/files/static/images/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/esp/www/files/static/images/splash.jpg -------------------------------------------------------------------------------- /src/libappweb.bit: -------------------------------------------------------------------------------- 1 | /* 2 | libappweb.bit -- Bit File for the Appweb library 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | libappweb: { 9 | type: 'lib', 10 | sources: [ '*.c' ], 11 | headers: [ '*.h' ], 12 | depends: [ 'libhttp' ], 13 | }, 14 | }, 15 | }) 16 | -------------------------------------------------------------------------------- /src/modules/README.md: -------------------------------------------------------------------------------- 1 | Appweb Loadable Modules 2 | ======================= 3 | 4 | The modules directory contains the source for the loadable modules. 5 | 6 | Key Files 7 | --------- 8 | 9 | * dirHandler.c - Directory listing handler 10 | * cgiHandler.c - CGI handler 11 | * espHandler.c - ESP handler 12 | * ejsHandler.c - Ejscript (JavaScript) handler 13 | * phpHandler.c - PHP handler 14 | * sslModule.c - Loadable SSL support 15 | -------------------------------------------------------------------------------- /src/modules/modules.bit: -------------------------------------------------------------------------------- 1 | /* 2 | modules.bit -- Bit File for Appweb modules 3 | */ 4 | 5 | Bit.load({ 6 | internal: { 7 | '+depends': [ 'libappweb' ], 8 | }, 9 | targets: { 10 | mod_cgi: { 11 | enable: 'bit.packs.cgi.enable', 12 | type: 'lib', 13 | sources: [ 'cgiHandler.c' ], 14 | }, 15 | mod_ejs: { 16 | enable: 'bit.packs.ejscript.enable', 17 | type: 'lib', 18 | sources: [ 'ejsHandler.c' ], 19 | depends: [ 'libejs' ], 20 | }, 21 | mod_php: { 22 | enable: 'bit.packs.php.enable', 23 | type: 'lib', 24 | sources: [ 'phpHandler.c' ], 25 | depends: [ 'php' ], 26 | '-compiler': [ 27 | '-Wall', 28 | '-Wshorten-64-to-32', 29 | ], 30 | }, 31 | mod_proxy: { 32 | enable: false, 33 | type: 'lib', 34 | sources: [ 'proxyHandler.c' ], 35 | }, 36 | mod_ssl: { 37 | enable: 'bit.packs.ssl.enable', 38 | type: 'lib', 39 | sources: [ 'sslModule.c' ], 40 | __depends: [ 'libmprssl', 'openssl', 'matrixssl' ], 41 | }, 42 | }, 43 | }) 44 | -------------------------------------------------------------------------------- /src/samples/c/simpleClient/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleClient sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleClient: { 12 | type: 'exe', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 15 | } 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /src/samples/c/simpleEjs/simpleEjs.conf: -------------------------------------------------------------------------------- 1 | Listen 8888 2 | LoadModule chunkFilter mod_chunk 3 | AddFilter chunkFilter 4 | LoadModule ejsHandler mod_ejs 5 | AddHandler ejsHandler .ejs .es 6 | -------------------------------------------------------------------------------- /src/samples/c/simpleEjs/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleEjs sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleEjs: { 12 | type: 'exe', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 15 | }, 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /src/samples/c/simpleEsp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Embedded Gateway Interface (EGI) Sample 4 | 5 | 6 | 7 | 8 |

Embedded Gateway Interface (EGI) Sample

9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 |
Name:
Address:
20 | 21 | 22 |
25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/samples/c/simpleEsp/simpleEsp.conf: -------------------------------------------------------------------------------- 1 | Listen 8888 2 | LoadModule chunkFilter mod_chunk 3 | AddFilter chunkFilter 4 | LoadModule egiHandler mod_egi 5 | AddHandler egiHandler .egi 6 | LoadModule fileHandler mod_file 7 | AddHandler fileHandler .html 8 | -------------------------------------------------------------------------------- /src/samples/c/simpleEsp/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleEsp sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleEsp: { 12 | type: 'exe', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl', '/usr/lib/appweb/latest/lib/mod_esp${SHLIB}' ], 15 | }, 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /src/samples/c/simpleHandler/appweb.conf: -------------------------------------------------------------------------------- 1 | Listen 7777 2 | LoadModule simpleHandler ./simpleHandler 3 | AddHandler simpleHandler .html 4 | -------------------------------------------------------------------------------- /src/samples/c/simpleHandler/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleHandler sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleHandler: { 12 | type: 'lib', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 15 | } 16 | }, 17 | }) 18 | 19 | -------------------------------------------------------------------------------- /src/samples/c/simpleModule/README.md: -------------------------------------------------------------------------------- 1 | SimpleModule Sample 2 | === 3 | 4 | To test the SimpleModule you need to add the following line to the configuration file of your appweb server. 5 | 6 | LoadModule simpleModule ./mod_simple 7 | -------------------------------------------------------------------------------- /src/samples/c/simpleModule/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleModule sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleModule: { 12 | type: 'lib', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 15 | } 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /src/samples/c/simpleServer/index.html: -------------------------------------------------------------------------------- 1 | 2 | index.html 3 | 4 | My index.html 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/samples/c/simpleServer/simpleServer.conf: -------------------------------------------------------------------------------- 1 | Listen 8888 2 | AddOutputFilter chunkFilter 3 | LoadModule fileHandler mod_file 4 | AddHandler fileHandler 5 | -------------------------------------------------------------------------------- /src/samples/c/simpleServer/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the simpleServer sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | simpleServer: { 12 | type: 'exe', 13 | sources: ['*.c'], 14 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 15 | }, 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /src/samples/c/spyFilter/README.md: -------------------------------------------------------------------------------- 1 | SpyFilter Sample 2 | === 3 | 4 | To test the spyFilter you need to add the following line to the configuration file of your appweb server. 5 | 6 | LoadModule spyFilter mod_spy 7 | AddInputFilter spyFilter 8 | -------------------------------------------------------------------------------- /src/samples/cpp/cppHandler/appweb.conf: -------------------------------------------------------------------------------- 1 | Listen 7777 2 | LoadModule simpleHandler ./simpleHandler 3 | AddHandler simpleHandler .html 4 | -------------------------------------------------------------------------------- /src/samples/cpp/cppHandler/cppModule.def: -------------------------------------------------------------------------------- 1 | LIBRARY cppModule.dll 2 | EXPORTS 3 | maSimpleHandlerInit -------------------------------------------------------------------------------- /src/samples/cpp/cppHandler/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the cppHandler sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | cppHandler: { 12 | type: 'lib', 13 | path: 'cppModule${SHOBJ}', 14 | sources: ['*.cpp'], 15 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 16 | } 17 | }, 18 | }) 19 | 20 | -------------------------------------------------------------------------------- /src/samples/cpp/cppModule/README.md: -------------------------------------------------------------------------------- 1 | SimpleModule Sample 2 | === 3 | 4 | To test the SimpleModule you need to add the following line to the configuration file of your appweb server. 5 | 6 | LoadModule simpleModule ./mod_simple 7 | -------------------------------------------------------------------------------- /src/samples/cpp/cppModule/cppModule.def: -------------------------------------------------------------------------------- 1 | LIBRARY cppModule.dll 2 | EXPORTS 3 | maSimpleModuleInit -------------------------------------------------------------------------------- /src/samples/cpp/cppModule/start.bit: -------------------------------------------------------------------------------- 1 | /* 2 | start.bit - Bit file for the cppModule sample 3 | */ 4 | 5 | Bit.load({ 6 | defaults: { 7 | '+includes': [ '/usr/lib/appweb/latest/inc' ], 8 | '+libpaths': [ '/usr/lib/appweb/latest/bin' ], 9 | }, 10 | targets: { 11 | cppModule: { 12 | type: 'lib', 13 | path: 'cppModule${SHOBJ}', 14 | sources: ['*.cpp'], 15 | '+libraries': [ 'appweb', 'http', 'mpr', 'mprssl' ], 16 | } 17 | }, 18 | }) 19 | 20 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/array.js: -------------------------------------------------------------------------------- 1 | // 2 | // Array test 3 | // 4 | 5 | var o = new Array(); 6 | assert(o.length == 0); 7 | 8 | o["abc"] = 8; 9 | assert(o["abc"] == 8); 10 | assert(o.length == 1); 11 | 12 | o[1] = 7; 13 | assert(o[1] == 7); 14 | assert(o.length == 2); 15 | 16 | // 17 | // This should fail, length is readonly 18 | // 19 | // o.length = 99; 20 | // 21 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/autoinc.js: -------------------------------------------------------------------------------- 1 | // 2 | // Auto inc / dec test 3 | // 4 | 5 | i = 0; 6 | i++; 7 | i--; 8 | 9 | assert(i == 0); 10 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/comment.js: -------------------------------------------------------------------------------- 1 | // 2 | // Comment test 3 | // 4 | 5 | /* C style comments are okay too */ 6 | 7 | var x; // Comments should work at the end of the line also 8 | 9 | var y; 10 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/constructor.js: -------------------------------------------------------------------------------- 1 | // 2 | // Constructor test 3 | // 4 | 5 | function MyFunc(a, b) { 6 | } 7 | 8 | var o = new MyFunc(1, 2); 9 | 10 | println("o.toString = " + o.toString); 11 | println(o); 12 | println("o.toValue = " + o.toValue); 13 | 14 | var b = new Boolean(); 15 | 16 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/float.js: -------------------------------------------------------------------------------- 1 | // 2 | // Math test (need try / catch to use effectively) 3 | // 4 | var f; 5 | 6 | var f = Infinity; 7 | 8 | var f = NaN; 9 | 10 | var a = 0.0 / 0.0; 11 | 12 | assert(a == NaN); 13 | 14 | // 15 | // try { a = 7 / x; } 16 | // catch { } 17 | //b = x / 0; 18 | //c = 7 / 0; 19 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/for.js: -------------------------------------------------------------------------------- 1 | // 2 | // For test 3 | // 4 | 5 | j = 0; 6 | for (i = 0; i < 50; i++) { 7 | j = j + i; 8 | assert(j == i + 1); 9 | } 10 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/foreach.js: -------------------------------------------------------------------------------- 1 | // 2 | // for in test 3 | // 4 | 5 | var cat = new Object(); 6 | f="name"; 7 | cat[f] = 2; 8 | 9 | cat.name = "Felix the Cat"; 10 | cat.address = "1286 NE 8th Street"; 11 | cat.age = 9; 12 | 13 | for (var s in cat) { 14 | println(" cat." + s + " = " + cat[s]); 15 | } 16 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/function.js: -------------------------------------------------------------------------------- 1 | // 2 | // Function test 3 | // 4 | 5 | function myFunc(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) { 6 | assert(q == "last"); 7 | 8 | for (i = 0; i < arguments.length; i++) { 9 | println("arg[" + i + "] = " + arguments[i]); 10 | } 11 | } 12 | 13 | myFunc(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, "last"); 14 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/if.js: -------------------------------------------------------------------------------- 1 | // 2 | // if test 3 | // 4 | 5 | x=1; 6 | if(x==1){ 7 | y = true; 8 | }else{ 9 | y = false; 10 | } 11 | assert(y == true); 12 | 13 | if (x == 1) { 14 | y = 1; 15 | } else if (x == 2) { 16 | y = 2; 17 | } else if (x == 3) { 18 | y = 3; 19 | } 20 | 21 | assert(x == y); 22 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/inc.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | i = 4; 3 | i = 5; 4 | %> 5 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/inc.js: -------------------------------------------------------------------------------- 1 | // 2 | // Assign 3 to i. 3 | // 4 | i=3; 5 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/method.js: -------------------------------------------------------------------------------- 1 | // 2 | // Test methods 3 | // 4 | 5 | function MyObj() { 6 | this.x = 1; 7 | this.y = 2; 8 | } 9 | 10 | function toValue() { 11 | return 48; 12 | } 13 | 14 | var o = new new MyObj(); 15 | 16 | //MyObj.prototype.z = 7; 17 | //MyObj.prototype.z = 7; 18 | 19 | 20 | // 21 | // Assign method 22 | // 23 | o.toValue = toValue; 24 | 25 | println("toValue is " + o.toValue()); 26 | assert(o.toValue() == 48); 27 | assert(o.x == 1); 28 | 29 | x = "abc" + o.toValue(); 30 | println("x is " + x); 31 | assert(x == "abc48"); 32 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/null.js: -------------------------------------------------------------------------------- 1 | // 2 | // null test 3 | // 4 | 5 | // Should work 6 | var x; 7 | 8 | // println("x is " + x); 9 | 10 | assert(x == undefined); 11 | 12 | x = null; 13 | 14 | // println("x is " + x); 15 | 16 | assert(x == null); 17 | 18 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/object.js: -------------------------------------------------------------------------------- 1 | // 2 | // object test 3 | // 4 | 5 | var o = new Object(); 6 | 7 | o.a = 7; 8 | assert(o.a == 7); 9 | o.a = 9; 10 | 11 | assert(o.a == 9); 12 | 13 | o.b = new Array(); 14 | assert(o.b.length == 0); 15 | 16 | o.b.c = 8; 17 | o.b.d = 9; 18 | assert(o.b.c == 8); 19 | assert(o.b.length == 2); 20 | 21 | delete o.b.d; 22 | assert(o.b.length == 1); 23 | 24 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/printVar.js: -------------------------------------------------------------------------------- 1 | // 2 | // printVar test 3 | // 4 | 5 | var cat = new Object(); 6 | var breed = new Object(); 7 | 8 | breed.country = "australia"; 9 | breed.pure = false; 10 | 11 | cat.name = "fluffy"; 12 | cat.address = "9440 Lake"; 13 | cat.heritage = breed; 14 | 15 | println(cat); 16 | printVars(cat); 17 | printVars(breed); 18 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/refCount.js: -------------------------------------------------------------------------------- 1 | // 2 | // refCount test 3 | // 4 | 5 | var a = new Object(); 6 | assert(refCount(a) > 1); 7 | 8 | b = a; 9 | assert(refCount(a) > 2); 10 | 11 | c = b; 12 | assert(refCount(a) > 3); 13 | 14 | c = 1; 15 | assert(refCount(a) > 2); 16 | 17 | b = 1; 18 | assert(refCount(a) > 1); 19 | 20 | a = 1; 21 | assert(refCount(a) == 0); 22 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/toString.js: -------------------------------------------------------------------------------- 1 | // 2 | // Define a toString method and cast an object to a string 3 | // 4 | function toString() { 5 | return this.name; 6 | } 7 | 8 | var cat = new Object(); 9 | cat.name = "Felix the Cat"; 10 | cat.toString = toString; 11 | 12 | println("Name: " + cat); 13 | 14 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/trace.js: -------------------------------------------------------------------------------- 1 | // 2 | // trace test 3 | // 4 | 5 | // trace("Test Trace Statement\n"); 6 | // trace(2, "Another Trace Statement\n"); 7 | -------------------------------------------------------------------------------- /src/samples/ejs/languageFeatures/var.js: -------------------------------------------------------------------------------- 1 | // 2 | // var test 3 | // 4 | 5 | var x; 6 | assert(x == undefined); 7 | 8 | var a, b, c; 9 | assert(a == undefined); 10 | assert(b == undefined); 11 | assert(c == undefined); 12 | assert(a == undefined && b == undefined && c == undefined); 13 | 14 | var d = 1, e = "Sunny Day", f = 3 / 1; 15 | assert(d == 1); 16 | assert(f == 3); 17 | assert(e == "Sunny Day"); 18 | 19 | x = 4; 20 | assert(x == 4); 21 | 22 | var undefVar; 23 | x = undefVar; 24 | assert(x == undefined); 25 | if (undefVar != undefined) { 26 | assert(0); 27 | } 28 | 29 | var x; 30 | assert(x == undefined); 31 | 32 | // Should fail 33 | // var o.y; 34 | 35 | -------------------------------------------------------------------------------- /src/server/appweb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/appweb.ico -------------------------------------------------------------------------------- /src/server/groups.db: -------------------------------------------------------------------------------- 1 | # 2 | # groups.db 3 | # 4 | # Fields: Enable/Disable: ACL: GroupName: users 5 | # 6 | # Example: 7 | 8 | 1: 1000: coyoteUsers: peter julie 9 | -------------------------------------------------------------------------------- /src/server/rom.files: -------------------------------------------------------------------------------- 1 | . 2 | appweb.conf 3 | mime.types 4 | users.db 5 | groups.db 6 | conf 7 | conf/doc.conf 8 | conf/hosts 9 | conf/hosts/named-vhost-sample.conf 10 | conf/hosts/vhost-sample.conf 11 | conf/log.conf 12 | conf/modules 13 | conf/modules/cgi.conf 14 | conf/modules/dir.conf 15 | conf/modules/upload.conf 16 | conf/tune.conf 17 | web 18 | web/favicon.ico 19 | web/icons 20 | web/icons/back.gif 21 | web/icons/blank.gif 22 | web/icons/compressed.gif 23 | web/icons/folder.gif 24 | web/icons/parent.gif 25 | web/icons/space.gif 26 | web/icons/text.gif 27 | web/iehacks.css 28 | web/images 29 | web/images/banner.jpg 30 | web/images/bottomShadow.jpg 31 | web/images/shadow.jpg 32 | web/index.html 33 | web/min-index.html 34 | web/print.css 35 | web/screen.css 36 | web/test 37 | web/test/big.cgi 38 | web/test/big.txt 39 | web/test/test.cgi 40 | web/test/test.html 41 | web/test/test.pl 42 | web/test/test.py 43 | web/test/upload 44 | web/test/upload/upload-cgi.html 45 | web/test/upload/upload.html 46 | web/test/upload/uploadComplete.html 47 | -------------------------------------------------------------------------------- /src/server/server.bit: -------------------------------------------------------------------------------- 1 | /* 2 | server.bit -- Bit File for appweb server 3 | */ 4 | 5 | Bit.load({ 6 | targets: { 7 | appweb: { 8 | type: 'exe', 9 | /* 10 | To link statically, uncomment this and edit the 'depends' property with the required modules. 11 | static: true, 12 | depends: ['libappweb', 'mod_esp', 'mod_ssl'], 13 | */ 14 | depends: [ 'libappweb' ], 15 | sources: [ 'appweb.c' ], 16 | headers: [ '*.h' ], 17 | }, 18 | 19 | appwebMonitor: { 20 | enable: bit.platform.like == 'windows', 21 | type: 'exe', 22 | rule: 'gui' 23 | depends: [ 'libappweb' ], 24 | sources: [ 'windows/appwebMonitor.c' ], 25 | headers: [ ], 26 | libraries: [ 'shell32.lib' ], 27 | resources: [ 'windows/appwebMonitor.rc' ], 28 | }, 29 | 30 | 'appwebMonitor.ico': { 31 | enable: bit.platform.like == 'windows', 32 | type: 'file', 33 | files: [ 'windows/appwebMonitor.ico' ], 34 | build: "cp('windows/appwebMonitor.ico', ${BIN})", 35 | generate: 'cp windows/appwebMonitor.ico ${BIN}', 36 | }, 37 | }, 38 | }) 39 | -------------------------------------------------------------------------------- /src/server/users.db: -------------------------------------------------------------------------------- 1 | # 2 | # users.db -- Use httpPassword to create. 3 | # 4 | # Fields: Enable/Disable: UserName: Realm: Password 5 | # 6 | # Example: 7 | 8 | 1: joshua: Acme Inc: 3cc654d84f2b4361fe45a0c92e3f0e0b 9 | -------------------------------------------------------------------------------- /src/server/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/favicon.ico -------------------------------------------------------------------------------- /src/server/web/icons/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/back.gif -------------------------------------------------------------------------------- /src/server/web/icons/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/blank.gif -------------------------------------------------------------------------------- /src/server/web/icons/compressed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/compressed.gif -------------------------------------------------------------------------------- /src/server/web/icons/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/folder.gif -------------------------------------------------------------------------------- /src/server/web/icons/parent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/parent.gif -------------------------------------------------------------------------------- /src/server/web/icons/space.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/space.gif -------------------------------------------------------------------------------- /src/server/web/icons/text.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/icons/text.gif -------------------------------------------------------------------------------- /src/server/web/iehacks.css: -------------------------------------------------------------------------------- 1 | *div.contentLeft { 2 | float: left; 3 | } 4 | -------------------------------------------------------------------------------- /src/server/web/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/images/banner.jpg -------------------------------------------------------------------------------- /src/server/web/images/bottomShadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/images/bottomShadow.jpg -------------------------------------------------------------------------------- /src/server/web/images/shadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/web/images/shadow.jpg -------------------------------------------------------------------------------- /src/server/web/min-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Embedthis Appweb 5 | 6 | 7 | 8 |

Welcome to Appweb

9 | 10 | 11 | -------------------------------------------------------------------------------- /src/server/web/print.css: -------------------------------------------------------------------------------- 1 | pre { 2 | font-size: 110%; 3 | line-height: 140%; 4 | font-family: Consolas, Monaco, Courier, Courier New, Courier, monospace; 5 | padding: 10px 15px 10px 15px; 6 | margin: 16px 0 20px 0; 7 | background-color: #EEEEFF; 8 | color: #000000; 9 | border: 1px solid #444455; 10 | } 11 | 12 | pre b { 13 | color: #000; 14 | font-weight: bold; 15 | } 16 | -------------------------------------------------------------------------------- /src/server/web/test/bench.html: -------------------------------------------------------------------------------- 1 | 0123456789012345678901234567890123456789012345678 2 | 0123456789012345678901234567890123456789012345678 3 | 0123456789012345678901234567890123456789012345678 4 | 0123456789012345678901234567890123456789012345678 5 | 0123456789012345678901234567890123456789012345678 6 | 0123456789012345678901234567890123456789012345678 7 | 0123456789012345678901234567890123456789012345678 8 | 0123456789012345678901234567890123456789012345678 9 | 0123456789012345678901234567890123456789012345678 10 | 0123456789012345678901234567890123456789012345678 11 | 0123456789012345678901234567890123456789012345678 12 | 0123456789012345678901234567890123456789012345678 13 | 0123456789012345678901234567890123456789012345678 14 | 0123456789012345678901234567890123456789012345678 15 | 0123456789012345678901234567890123456789012345678 16 | 0123456789012345678901234567890123456789012345678 17 | 0123456789012345678901234567890123456789012345678 18 | 0123456789012345678901234567890123456789012345678 19 | 0123456789012345678901234567890123456789012345678 20 | 0123456789012345678901234567890123456789012345678 21 | -------------------------------------------------------------------------------- /src/server/web/test/test.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "HTTP/1.0 200 OK" 4 | echo "Content-type: text/html" 5 | echo "" 6 | echo "" 7 | echo "" 8 | echo "

Simple CGI program

" 9 | echo "
" 
10 | # env
11 | echo "
" 12 | echo "" 13 | -------------------------------------------------------------------------------- /src/server/web/test/test.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ejscript Test Script 4 | 5 | 6 |

Ejscript Test Script

7 |

server Time: <%= Date() %>

8 | 9 | 10 | -------------------------------------------------------------------------------- /src/server/web/test/test.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

<% render("Hello ESP World"); %>

4 | 5 | 6 | -------------------------------------------------------------------------------- /src/server/web/test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple 4 | 5 | 6 | Hello world 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/server/web/test/test.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/server/web/test/test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | print "Content-type: text/html\n"; 4 | print "\n"; 5 | print "\n"; 6 | print "\n"; 7 | print "\n"; 8 | print "

Hello World from Perl

\n"; 9 | print ""; 10 | print ""; 11 | 12 | 0; 13 | -------------------------------------------------------------------------------- /src/server/web/test/test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | print "Content-type: text/html\n\n" 4 | print "Hello world from Python Land!" 5 | -------------------------------------------------------------------------------- /src/server/windows/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the Windows Appweb server components 3 | # 4 | # Copyright (c) Embedthis Software LLC, 2003-2012. All Rights Reserved. 5 | # 6 | 7 | BUILD_CROSS := 0 8 | 9 | include .makedep 10 | 11 | ifeq ($(BUILDING_TARGET),1) 12 | TARGETS += $(BIT_PRODUCT)Monitor$(BIT_EXE) 13 | ifeq ($(BIT_OS),WIN) 14 | SYSLIBS += shell32.lib 15 | MONITOR_RES = --resources appwebMonitor.rc 16 | endif 17 | endif 18 | 19 | compileExtra: $(TARGETS) 20 | 21 | # 22 | # Link the monitor 23 | # 24 | $(BIT_PRODUCT)Monitor$(BIT_EXE): $(BIT_LIB_DIR)/libmpr$(BIT_LIB) $(OBJECTS) 25 | @bld --graphical --exe $(BIT_PRODUCT)Monitor$(BIT_EXE) --rpath "$(BIT_LIB_PREFIX)" --rpath "../bin" \ 26 | --search "$(LIBPATH)" $(MODE) --libs "mpr" $(MONITOR_RES) --syslibs "$(SYSLIBS)" \ 27 | $(BIT_OBJ_DIR)/$(BIT_PRODUCT)Monitor$(BIT_OBJ) 28 | cp $(BIT_PRODUCT)Monitor$(BIT_EXE) $(BIT_BIN_DIR)/$(BIT_PRODUCT)Monitor$(BIT_EXE) 29 | cp $(BIT_PRODUCT)Monitor.ico $(BIT_BIN_DIR) 30 | 31 | # 32 | # Local variables: 33 | # tab-width: 4 34 | # c-basic-offset: 4 35 | # End: 36 | # vim: sw=4 ts=4 noexpandtab 37 | # 38 | -------------------------------------------------------------------------------- /src/server/windows/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/admin.png -------------------------------------------------------------------------------- /src/server/windows/appweb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/appweb.bmp -------------------------------------------------------------------------------- /src/server/windows/appweb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/appweb.png -------------------------------------------------------------------------------- /src/server/windows/appweb.rc: -------------------------------------------------------------------------------- 1 | /* 2 | appweb.rc - Windows Appweb resource file 3 | 4 | 5 | Copyright (c) Embedthis Software LLC, 2003-2012. All Rights Reserved. 6 | The latest version of this code is available at http://www.embedthis.com 7 | 8 | This software is open source; you can redistribute it and/or modify it 9 | under the terms of the GNU General Public License as published by the 10 | Free Software Foundation; either version 2 of the License, or (at your 11 | option) any later version. 12 | 13 | This program is distributed WITHOUT ANY WARRANTY; without even the 14 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | See the GNU General Public License for more details at: 16 | http://www.embedthis.com/downloads/gplLicense.html 17 | 18 | This General Public License does NOT permit incorporating this software 19 | into proprietary programs. If you are unable to comply with the GPL, a 20 | commercial license for this software and support services are available 21 | from Embedthis Software at http://www.embedthis.com 22 | */ 23 | 24 | /* 25 | Icons 26 | */ 27 | icon ICON DISCARDABLE "appweb.ico" 28 | -------------------------------------------------------------------------------- /src/server/windows/appwebMonitor.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/appwebMonitor.ico -------------------------------------------------------------------------------- /src/server/windows/appwebMonitor.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/appwebMonitor.psd -------------------------------------------------------------------------------- /src/server/windows/go.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/go.bmp -------------------------------------------------------------------------------- /src/server/windows/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/go.png -------------------------------------------------------------------------------- /src/server/windows/mon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/mon.ico -------------------------------------------------------------------------------- /src/server/windows/stop.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/stop.bmp -------------------------------------------------------------------------------- /src/server/windows/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/stop.png -------------------------------------------------------------------------------- /src/server/windows/two.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/src/server/windows/two.ico -------------------------------------------------------------------------------- /src/utils/utils.bit: -------------------------------------------------------------------------------- 1 | /* 2 | utils.bit -- Bit File for Utilities 3 | */ 4 | 5 | Bit.load({ 6 | 7 | targets: { 8 | authpass: { 9 | type: 'exe', 10 | sources: [ 'authpass.c' ], 11 | depends: [ 'libappweb' ], 12 | platforms: [ 'local' ], 13 | }, 14 | 15 | cgiProgram: { 16 | type: 'exe', 17 | sources: [ 'cgiProgram.c' ], 18 | }, 19 | 20 | setConfig: { 21 | type: 'exe', 22 | rule: 'gui', 23 | sources: [ 'setConfig.c' ], 24 | depends: [ 'libmpr' ], 25 | platforms: [ 'local' ], 26 | }, 27 | }, 28 | }) 29 | -------------------------------------------------------------------------------- /test/api/c.tst: -------------------------------------------------------------------------------- 1 | /* 2 | c.tst - Test the Appweb C API 3 | */ 4 | 5 | const HOST = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let command = Cmd.locate("testAppweb").portable + " --host " + HOST + " --name appweb.api.c " + test.mapVerbosity(-3) 8 | Cmd.sh(command) 9 | -------------------------------------------------------------------------------- /test/api/load.tst: -------------------------------------------------------------------------------- 1 | /* 2 | load.tst - Load tests 3 | */ 4 | 5 | const HOST = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | if (App.test.depth >= 4) { 8 | let command = Cmd.locate("testAppweb").portable + " --host " + HOST + 9 | " --name mpr.api.c --iterations 400 " + test.mapVerbosity(-2) 10 | 11 | Cmd.sh(command) 12 | for each (count in [2, 4, 8, 16]) { 13 | Cmd.sh(command + " --threads " + count) 14 | } 15 | } else { 16 | test.skip("Runs at depth 4") 17 | } 18 | -------------------------------------------------------------------------------- /test/api/thread.tst: -------------------------------------------------------------------------------- 1 | /* 2 | thread.tst - Multithreaded test of the Appweb 3 | */ 4 | 5 | /* 6 | MOB - not working reliably 7 | 8 | let command = Cmd.locate("testAppweb").portable + " --host " + App.config.uris.http + " --name mpr.api.c --iterations 5 " + 9 | test.mapVerbosity(-2) 10 | 11 | for each (threadCount in [2, 4, 8, 16]) { 12 | print(command + "--threads " + threadCount) 13 | Cmd.sh(command + "--threads " + threadCount) 14 | } 15 | */ 16 | -------------------------------------------------------------------------------- /test/app/cache/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/app/cache/.keep -------------------------------------------------------------------------------- /test/app/db/test.mdb: -------------------------------------------------------------------------------- 1 | { 2 | 'post': { 3 | hints: { 4 | ncols: 3 5 | }, 6 | schema: { 7 | 'id': { type: 'string', autoinc: 'true', index: 'true', key: 'true' }, 8 | 'title': { type: 'string' }, 9 | 'body': { type: 'text' }, 10 | }, 11 | data: [ 12 | [ '4', 'Fourth post', 'dog', ], 13 | [ '5', 'Yet another', 'more text 14 | dog', ], 15 | ], 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /test/app/layouts/default.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% securityToken(); %> 6 | <% icon(0, 0); %> 7 | <% stylesheet(0, 0); %> 8 | <% script(0, 0); %> 9 | Test App 10 | 11 | 12 |
13 |

<% label("Blog Application", "{data-click: '~'}"); %>

14 |
15 | 16 | <% flash("all", NULL); %> 17 |
18 | <%@ content %> 19 |
20 |
21 |

Powered by Appweb™

22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /test/app/static/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/app/static/images/banner.jpg -------------------------------------------------------------------------------- /test/app/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/app/static/images/favicon.ico -------------------------------------------------------------------------------- /test/app/static/images/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/app/static/images/splash.jpg -------------------------------------------------------------------------------- /test/app/views/post-edit.esp: -------------------------------------------------------------------------------- 1 |

<%= hasRec() ? "Edit" : "Create" %> Post

2 | 3 | <% form(0, 0); %> 4 | 5 | <% { 6 | char *name, *uname; 7 | int next; 8 | MprList *cols = getColumns(NULL); 9 | for (ITERATE_ITEMS(cols, name, next)) { 10 | if (smatch(name, "id")) continue; 11 | uname = spascal(name); 12 | %> 13 | 14 | <% } %> 15 | <% } %> 16 |
<% render(uname); %><% input(name, 0); %>
17 | <% button("commit", "OK", 0); %> 18 | <% buttonLink("Cancel", "@", 0); %> 19 | <% if (hasRec()) buttonLink("Delete", "@destroy", "{data-method: 'DELETE'}"); %> 20 | <% endform(); %> 21 | -------------------------------------------------------------------------------- /test/app/views/post-list.esp: -------------------------------------------------------------------------------- 1 |

Post List

2 | 3 | <% 4 | EdiGrid *grid = readTable("post"); 5 | table(grid, "{ \ 6 | data-click: '@edit', \ 7 | columns: { \ 8 | id: { header: 'ID' }, \ 9 | title: { header: 'TITLE' }, \ 10 | body: { header: 'BODY' }, \ 11 | } \ 12 | "); %> 13 | <% buttonLink("New Post", "@init", 0); %> 14 | -------------------------------------------------------------------------------- /test/app/views/test-cmd-details.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <% setFlash("warn", "Test warning"); %> 5 |

Edit

6 | SECRET: @@secret 7 | 8 | <% alert("", "{escape: true}"); %> 9 | <% anchor("Hello World", getReferrer(conn), "{escape: true}"); %> 10 | 11 | <% button("commit", "OK", NULL); %> 12 | <% button("commit", "Cancel", NULL); %> 13 | 14 | <% buttonLink("Cancel", "@", NULL); %> 15 | 16 | <% checkbox("Admin", "true", NULL); %> 17 | <% division("

Hello

", "{ class: 'blue', width: '70%', special: 'high' }"); %> 18 | 19 | <% flash("all", NULL); %> 20 | <% form(NULL, NULL); %> 21 | <% endform(); %> 22 | -------------------------------------------------------------------------------- /test/app/views/test-cmd-login.esp: -------------------------------------------------------------------------------- 1 |

Please Login

2 |
3 | 4 | 5 | 6 | 7 |
Username
Password
Favorite Color
8 | 9 |
10 | -------------------------------------------------------------------------------- /test/auth.conf: -------------------------------------------------------------------------------- 1 | # 2 | # new.conf - Authorization data 3 | # 4 | 5 | Role administrator view 6 | Role executive manage direct 7 | Role user view 8 | 9 | User julie 9d8873a123eb506e7f8e84d1f2a26916 user 10 | User peter 7cdba57892649fd95a540683fdf8fba6 user 11 | User joshua 2fd6e47ff9bb70c0465fd2f5c8e5305e user administrator purchase 12 | User mary 5b90553bea8ba3686f4239d62801f0f3 user executive 13 | -------------------------------------------------------------------------------- /test/auth/digest.tst: -------------------------------------------------------------------------------- 1 | /* 2 | digest.tst - Digest authentication tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.setCredentials("anybody", "PASSWORD WONT MATTER") 9 | http.get(HTTP + "/index.html") 10 | assert(http.status == 200) 11 | 12 | // Digest tests 13 | // Access to digest/digest.html accepts by any valid user 14 | http.reset() 15 | http.get(HTTP + "/auth/digest/digest.html") 16 | assert(http.status == 401) 17 | 18 | http.setCredentials("joshua", "pass1") 19 | http.get(HTTP + "/auth/digest/digest.html") 20 | assert(http.status == 200) 21 | 22 | http.setCredentials("mary", "pass2") 23 | http.get(HTTP + "/auth/digest/digest.html") 24 | assert(http.status == 200) 25 | 26 | // Access accepts joshua only 27 | http.setCredentials(null, null) 28 | http.get(HTTP + "/auth/digest/joshua/user.html") 29 | assert(http.status == 401) 30 | 31 | http.setCredentials("joshua", "pass1") 32 | http.get(HTTP + "/auth/digest/joshua/user.html") 33 | assert(http.status == 200) 34 | 35 | http.setCredentials("mary", "pass2") 36 | http.get(HTTP + "/auth/digest/joshua/user.html") 37 | assert(http.status == 403) 38 | -------------------------------------------------------------------------------- /test/basic/alias.tst: -------------------------------------------------------------------------------- 1 | /* 2 | alias.tst - Alias http tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let http: Http = new Http 8 | 9 | http.get(HTTP + "/aliasDir/atest.html") 10 | assert(http.status == 200) 11 | assert(http.response.contains("alias/atest.html")) 12 | 13 | http.get(HTTP + "/aliasFile/") 14 | assert(http.status == 200) 15 | assert(http.response.contains("alias/atest.html")) 16 | 17 | http.get(HTTP + "/AliasDocs/index.html") 18 | assert(http.status == 200) 19 | assert(http.response.contains("My Documents/index.html")) 20 | http.close() 21 | -------------------------------------------------------------------------------- /test/basic/chunk.tst: -------------------------------------------------------------------------------- 1 | /* 2 | chunk.tst - Test chunked transfer encoding for response data 3 | 4 | MOB - incomplete 5 | */ 6 | 7 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 8 | let http: Http = new Http 9 | 10 | http.post(HTTP + "/index.html") 11 | http.wait() 12 | assert(http.status == 200) 13 | 14 | // TODO - more here. Test various chunk sizes. 15 | // TODO - want to be able to set the chunk size? 16 | -------------------------------------------------------------------------------- /test/basic/dir.tst: -------------------------------------------------------------------------------- 1 | /* 2 | dir.tst - Directory GET tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_dir) { 9 | /* TODO DIRECTORY LISTINGS NEEDED 10 | http.get(HTTP + "/dir/") 11 | assert(http.status == 200) 12 | // assert(http.readString().contains("Hello")) 13 | 14 | // Validate get contents 15 | http.get(HTTP + "/index.html") 16 | assert(http.readString(12) == "") 17 | assert(http.readString(7) == "") 18 | 19 | // Validate get contents 20 | http.get(HTTP + "/index.html") 21 | assert(http.response.endsWith("</html>\n")) 22 | assert(http.response.endsWith("</html>\n")) 23 | 24 | // Test Get with a body. Yes this is valid Http, although unusual. 25 | http.get(HTTP + "/index.html", {name: "John", address: "700 Park Ave"}) 26 | assert(http.status == 200) 27 | */ 28 | 29 | } else { 30 | test.skip("directory listings not enabled") 31 | } 32 | -------------------------------------------------------------------------------- /test/basic/get.tst: -------------------------------------------------------------------------------- 1 | /* 2 | get.tst - Http GET tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Basic get. Validate response code and contents 9 | http.get(HTTP + "/index.html") 10 | assert(http.status == 200) 11 | // assert(http.readString().contains("Hello")) 12 | 13 | // Validate get contents 14 | http.get(HTTP + "/index.html") 15 | assert(http.readString(12) == "<html><head>") 16 | assert(http.readString(7) == "<title>") 17 | 18 | // Validate get contents 19 | http.get(HTTP + "/index.html") 20 | assert(http.response.endsWith("</html>\n")) 21 | assert(http.response.endsWith("</html>\n")) 22 | 23 | // Test Get with a body. Yes this is valid Http, although unusual. 24 | http.get(HTTP + "/index.html", 'name=John&address=700+Park+Ave') 25 | assert(http.status == 200) 26 | 27 | if (test.os == "WIN") { 28 | http.get(HTTP + "/inDEX.htML") 29 | assert(http.status == 200) 30 | } 31 | -------------------------------------------------------------------------------- /test/basic/header.tst: -------------------------------------------------------------------------------- 1 | /* 2 | header.tst - Http response header tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | const URL = HTTP + "/index.html" 7 | let http: Http = new Http 8 | 9 | http.get(HTTP + "/index.html") 10 | connection = http.header("Connection") 11 | assert(connection == "keep-alive") 12 | 13 | http.get(HTTP + "/index.html") 14 | assert(http.statusMessage == "OK") 15 | assert(http.contentType == "text/html") 16 | assert(http.date != "") 17 | assert(http.lastModified != "") 18 | 19 | http.post(HTTP + "/index.html") 20 | assert(http.status == 200) 21 | 22 | // Request headers 23 | http.reset() 24 | http.setHeader("key", "value") 25 | http.get(HTTP + "/index.html") 26 | assert(http.status == 200) 27 | -------------------------------------------------------------------------------- /test/basic/methods.tst: -------------------------------------------------------------------------------- 1 | /* 2 | methods.tst - Test misc Http methods 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Test methods are caseless 9 | http.connect("GeT", HTTP + "/index.html") 10 | assert(http.status == 200) 11 | 12 | // Put a file 13 | data = Path("test.dat").readString() 14 | http.put(HTTP + "/tmp/test.dat", data) 15 | assert(http.status == 201 || http.status == 204) 16 | 17 | // Delete 18 | http.connect("DELETE", HTTP + "/tmp/test.dat") 19 | if (http.status != 204) { 20 | print("STATUS IS " + http.status) 21 | } 22 | assert(http.status == 204) 23 | 24 | // Post 25 | http.post(HTTP + "/index.html", "Some data") 26 | assert(http.status == 200) 27 | 28 | // Options 29 | http.connect("OPTIONS", HTTP + "/index.html") 30 | assert(http.header("Allow") == "OPTIONS,GET,HEAD,POST,PUT,DELETE") 31 | 32 | // Trace - should be disabled 33 | http.connect("TRACE", HTTP + "/index.html") 34 | assert(http.status == 406) 35 | 36 | // Head 37 | http.connect("HEAD", HTTP + "/index.html") 38 | assert(http.status == 200) 39 | assert(http.header("Content-Length") > 0) 40 | assert(http.response == "") 41 | -------------------------------------------------------------------------------- /test/basic/misc.tst: -------------------------------------------------------------------------------- 1 | /* 2 | misc.tst - Misc. Http tests 3 | */ 4 | 5 | assert(Uri("a.txt").mimeType == "text/plain") 6 | assert(Uri("a.html").mimeType == "text/html") 7 | assert(Uri("a.json").mimeType == "application/json") 8 | -------------------------------------------------------------------------------- /test/basic/php.tst: -------------------------------------------------------------------------------- 1 | /* 2 | php.tst - PHP tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | if (App.config.bit_php) { 8 | let http: Http = new Http 9 | 10 | // Simple Get 11 | http.get(HTTP + "/index.php") 12 | assert(http.status == 200) 13 | assert(http.response.contains("Hello PHP World")) 14 | 15 | // Get 16 | http.get(HTTP + "/form.php") 17 | assert(http.status == 200) 18 | assert(http.response.contains("form.php")) 19 | 20 | // Form 21 | http.form(HTTP + "/form.php?a=b&c=d", { name: "John Smith", address: "777 Mulberry Lane" }) 22 | assert(http.status == 200) 23 | assert(http.response.contains("name is John Smith")) 24 | assert(http.response.contains("address is 777 Mulberry Lane")) 25 | http.close() 26 | 27 | // Big output 28 | http.get(HTTP + "/big.php") 29 | assert(http.status == 200) 30 | data = new ByteArray 31 | while ((count = http.read(data))) { 32 | assert(data.toString().contains("aaaabbbb")) 33 | } 34 | 35 | } else { 36 | test.skip("PHP not enabled") 37 | } 38 | -------------------------------------------------------------------------------- /test/basic/post.tst: -------------------------------------------------------------------------------- 1 | /* 2 | post.tst - Post method tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let http: Http = new Http 8 | 9 | if (App.config.bit_ejscript) { 10 | http.post(HTTP + "/form.ejs", "Some data") 11 | assert(http.status == 200) 12 | http.close() 13 | 14 | http.form(HTTP + "/form.ejs", {name: "John", address: "700 Park Ave"}) 15 | assert(http.response.contains('"name": "John"')) 16 | assert(http.response.contains('"address": "700 Park Ave"')) 17 | http.close() 18 | 19 | } else { 20 | test.skip("Ejscript not enabled") 21 | } 22 | 23 | // TODO MORE 24 | -------------------------------------------------------------------------------- /test/basic/put.tst: -------------------------------------------------------------------------------- 1 | /* 2 | put.tst - Put method tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Test http.put with content data 9 | data = Path("test.dat").readString() 10 | http.put(HTTP + "/tmp/test.dat", data) 11 | assert(http.status == 201 || http.status == 204) 12 | http.reset() 13 | 14 | // This request should hang because we don't write any data and finalize. Wait with a timeout. 15 | http.setHeader("Content-Length", 1000) 16 | http.put(HTTP + "/tmp/a.tmp") 17 | assert(http.wait(250) == false) 18 | http.close() 19 | 20 | path = Path("test.dat") 21 | http.setHeader("Content-Length", path.size) 22 | http.put(HTTP + "/tmp/test.dat") 23 | file = File(path).open() 24 | buf = new ByteArray 25 | while (file.read(buf)) { 26 | http.write(buf) 27 | buf.flush() 28 | } 29 | file.close() 30 | http.finalize() 31 | http.wait() 32 | assert(http.status == 204) 33 | -------------------------------------------------------------------------------- /test/basic/query.tst: -------------------------------------------------------------------------------- 1 | /* 2 | query.tst - Http query tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_ejscript) { 9 | http.get(HTTP + "/form.ejs?a&b&c") 10 | assert(http.status == 200) 11 | assert(http.response.contains('"a": ""')) 12 | assert(http.response.contains('"b": ""')) 13 | assert(http.response.contains('"c": ""')) 14 | 15 | http.get(HTTP + "/form.ejs?a=x&b=y&c=z") 16 | assert(http.status == 200) 17 | assert(http.response.contains('"a": "x"')) 18 | assert(http.response.contains('"b": "y"')) 19 | assert(http.response.contains('"c": "z"')) 20 | 21 | } else { 22 | test.skip("Ejscript not enabled") 23 | } 24 | -------------------------------------------------------------------------------- /test/basic/read.tst: -------------------------------------------------------------------------------- 1 | /* 2 | read.tst - Various Http read tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | /* TODO 9 | // Validate readXml() 10 | http.get(HTTP + "/test.xml") 11 | assert(http.readXml().customer.name == "Joe Green") 12 | */ 13 | 14 | if (App.config.bit_ejscript) { 15 | // Test http.read() into a byte array 16 | http.get(HTTP + "/big.ejs") 17 | buf = new ByteArray 18 | count = 0 19 | while (http.read(buf) > 0) { 20 | count += buf.length 21 | } 22 | if (count != 63201) { 23 | print("COUNT IS " + count + " code " + http.status) 24 | } 25 | assert(count == 63201) 26 | http.close() 27 | } 28 | 29 | http.get(HTTP + "/lines.txt") 30 | lines = http.readLines() 31 | for (l in lines) { 32 | line = lines[l] 33 | assert(line.contains("LINE")) 34 | assert(line.contains((l+1).toString())) 35 | } 36 | assert(http.status == 200) 37 | -------------------------------------------------------------------------------- /test/basic/redirect.tst: -------------------------------------------------------------------------------- 1 | /* 2 | redirect.tst - Redirection tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // First just test a normal get 9 | http.get(HTTP + "/dir/index.html") 10 | assert(http.status == 200) 11 | 12 | http.followRedirects = false 13 | http.get(HTTP + "/dir") 14 | assert(http.status == 301) 15 | 16 | http.followRedirects = true 17 | http.get(HTTP + "/dir") 18 | assert(http.status == 200) 19 | 20 | http.followRedirects = true 21 | http.get(HTTP + "/dir/") 22 | assert(http.status == 200) 23 | assert(http.response.contains("Hello /dir/index.html")) 24 | -------------------------------------------------------------------------------- /test/basic/reuse.tst: -------------------------------------------------------------------------------- 1 | /* 2 | reuse.tst - Test Http reuse for multiple requests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let http: Http = new Http 8 | 9 | http.get(HTTP + "/index.html") 10 | assert(http.status == 200) 11 | 12 | http.get(HTTP + "/index.html") 13 | assert(http.status == 200) 14 | 15 | http.get(HTTP + "/index.html") 16 | assert(http.status == 200) 17 | 18 | http.get(HTTP + "/index.html") 19 | assert(http.status == 200) 20 | -------------------------------------------------------------------------------- /test/basic/secure.tst: -------------------------------------------------------------------------------- 1 | /* 2 | secure.tst - SSL http tests 3 | */ 4 | 5 | if (!Config.SSL) { 6 | test.skip("SSL not enabled in ejs") 7 | 8 | } else if (App.config.bit_ssl != false) { 9 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 10 | const HTTPS = App.config.uris.ssl || "https://127.0.0.1:4110" 11 | let http: Http = new Http 12 | 13 | http.verify = false 14 | http.get(HTTP + "/index.html") 15 | assert(!http.isSecure) 16 | http.close() 17 | 18 | http.verify = false 19 | http.get(HTTPS + "/index.html") 20 | assert(http.isSecure) 21 | http.close() 22 | 23 | http.verify = false 24 | http.get(HTTPS + "/index.html") 25 | assert(http.readString(12) == "<html><head>") 26 | assert(http.readString(7) == "<title>") 27 | http.close() 28 | 29 | // Validate get contents 30 | http.verify = false 31 | http.get(HTTPS + "/index.html?a=b") 32 | assert(http.response.endsWith("</html>\n")) 33 | assert(http.response.endsWith("</html>\n")) 34 | http.close() 35 | 36 | http.verify = false 37 | http.post(HTTPS + "/index.html", "Some data") 38 | assert(http.status == 200) 39 | http.close() 40 | 41 | } else { 42 | test.skip("SSL not enabled") 43 | } 44 | -------------------------------------------------------------------------------- /test/basic/stream.tst: -------------------------------------------------------------------------------- 1 | /* 2 | stream.tst - Http tests using streams 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_ejscript) { 9 | http.get(HTTP + "/big.ejs") 10 | ts = new TextStream(http) 11 | lines = ts.readLines() 12 | assert(lines.length == 801) 13 | assert(lines[0].contains("aaaaabbb") && lines[0].contains("00000")) 14 | assert(lines[799].contains("aaaaabbb") && lines[799].contains("00799")) 15 | 16 | } else { 17 | test.skip("Ejscript not enabled") 18 | } 19 | 20 | //TODO more 21 | -------------------------------------------------------------------------------- /test/basic/test.dat: -------------------------------------------------------------------------------- 1 | Test data: Thu Sep 17 20:17:22 PDT 2009 2 | -------------------------------------------------------------------------------- /test/basic/upload.tst: -------------------------------------------------------------------------------- 1 | /* 2 | upload.tst - File upload tests 3 | */ 4 | 5 | require ejs.unix 6 | 7 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 8 | let http: Http = new Http 9 | 10 | if (App.config.bit_ejscript) { 11 | http.upload(HTTP + "/upload.ejs", { myfile: "test.dat"} ) 12 | assert(http.status == 200) 13 | assert(http.response.contains('"clientFilename": "test.dat"')) 14 | assert(http.response.contains('Uploaded')) 15 | http.wait() 16 | 17 | http.upload(HTTP + "/upload.ejs", { myfile: "test.dat"}, {name: "John Smith", address: "100 Mayfair"} ) 18 | assert(http.status == 200) 19 | assert(http.response.contains('"clientFilename": "test.dat"')) 20 | assert(http.response.contains('Uploaded')) 21 | assert(http.response.contains('"address": "100 Mayfair"')) 22 | 23 | } else { 24 | test.skip("Ejscript not enabled") 25 | } 26 | -------------------------------------------------------------------------------- /test/benchmark/test.setup: -------------------------------------------------------------------------------- 1 | 2 | if (test.phase == "init" && test.depth < 6) { 3 | test.skip("Benchmark tests run at depth 5 or greater") 4 | } 5 | -------------------------------------------------------------------------------- /test/cache/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/cache/.keep -------------------------------------------------------------------------------- /test/caching/api.tst: -------------------------------------------------------------------------------- 1 | /* 2 | api.tst - Test configuration of caching by API 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_esp) { 9 | 10 | // Prep and clear the cache 11 | http.get(HTTP + "/app/cache/clear") 12 | assert(http.status == 200) 13 | 14 | // This will load the controller and configure caching for "api" 15 | http.get(HTTP + "/app/cache/api") 16 | assert(http.status == 200) 17 | 18 | // This request should now be cached 19 | http.get(HTTP + "/app/cache/api") 20 | assert(http.status == 200) 21 | let resp = deserialize(http.response) 22 | let first = resp.number 23 | assert(resp.uri == "/app/cache/api") 24 | assert(resp.query == "null") 25 | 26 | http.get(HTTP + "/app/cache/api") 27 | assert(http.status == 200) 28 | resp = deserialize(http.response) 29 | assert(resp.number == first) 30 | assert(resp.uri == "/app/cache/api") 31 | assert(resp.query == "null") 32 | 33 | http.close() 34 | 35 | } else { 36 | test.skip("ESP not enabled") 37 | } 38 | -------------------------------------------------------------------------------- /test/caching/big.tst: -------------------------------------------------------------------------------- 1 | /* 2 | big.tst - Test caching a big file 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Clear cached data 9 | http.get(HTTP + "/app/cache/clear") 10 | assert(http.status == 200) 11 | 12 | // Get a document that will normally require chunking 13 | http.get(HTTP + "/app/cache/big") 14 | assert(http.status == 200) 15 | assert(http.header("Transfer-Encoding") == "chunked") 16 | assert(!http.header("Content-Length")) 17 | assert(http.response.contains("Line: 00999 aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd<br/>")) 18 | 19 | // Get again, this time will be cached and will be sent not chunked 20 | http.get(HTTP + "/app/cache/big") 21 | assert(http.status == 200) 22 | assert(!http.header("Transfer-Encoding")) 23 | assert(http.header("Content-Length") == 78000) 24 | assert(http.response.contains("Line: 00999 aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd<br/>")) 25 | 26 | http.close() 27 | -------------------------------------------------------------------------------- /test/caching/client.tst: -------------------------------------------------------------------------------- 1 | /* 2 | client.tst - Test client caching 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.get(HTTP + "/app/cache/client") 9 | assert(http.status == 200) 10 | assert(http.header("Cache-Control") == "max-age=3600") 11 | 12 | http.close() 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/caching/combined.tst: -------------------------------------------------------------------------------- 1 | /* 2 | Combined.tst - Test combined caching. Params are ignored for caching URIs. 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Clear cache 9 | http.setHeader("Cache-Control", "no-cache") 10 | http.get(HTTP + "/combined/cache.esp") 11 | http.wait() 12 | 13 | // 1. Test that content is being cached 14 | // Initial get 15 | http.get(HTTP + "/combined/cache.esp") 16 | assert(http.status == 200) 17 | let resp = deserialize(http.response) 18 | let first = resp.number 19 | assert(resp.uri == "/combined/cache.esp") 20 | assert(resp.query == "null") 21 | 22 | // Second get, should get the same content (number must not change) 23 | http.get(HTTP + "/combined/cache.esp") 24 | assert(http.status == 200) 25 | resp = deserialize(http.response) 26 | assert(resp.number == first) 27 | assert(resp.uri == "/combined/cache.esp") 28 | assert(resp.query == "null") 29 | 30 | 31 | // 2. Test that different request parameters cache the same 32 | http.get(HTTP + "/combined/cache.esp?a=b&c=d") 33 | assert(http.status == 200) 34 | resp = deserialize(http.response) 35 | let firstQuery = resp.number 36 | assert(resp.number == first) 37 | assert(resp.uri == "/combined/cache.esp") 38 | assert(resp.query == "null") 39 | 40 | http.close() 41 | -------------------------------------------------------------------------------- /test/caching/ext.tst: -------------------------------------------------------------------------------- 1 | /* 2 | ext.tst - Test cache matching by extension. 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | /* 9 | Fetch twice and see if caching is working 10 | */ 11 | function cached(uri, expected): Boolean { 12 | http.get(HTTP + uri) 13 | assert(http.status == 200) 14 | let resp = deserialize(http.response) 15 | let first = resp.number 16 | 17 | http.get(HTTP + uri) 18 | assert(http.status == 200) 19 | resp = deserialize(http.response) 20 | http.close() 21 | if (expected != (resp.number == first)) { 22 | print("\nFirst number: " + first) 23 | print("\nSecond number: " + resp.number) 24 | dump(http.response) 25 | } 26 | return (resp.number == first) 27 | } 28 | 29 | // The esp request should be cached and the php should not 30 | if (App.config.bit_esp) { 31 | assert(cached("/ext/cache.esp", true)) 32 | } 33 | if (App.config.bit_php) { 34 | assert(!cached("/ext/cache.php", false)) 35 | } 36 | 37 | -------------------------------------------------------------------------------- /test/caching/handlers.tst: -------------------------------------------------------------------------------- 1 | /* 2 | handlers.tst - Test caching with various handler types 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // 1. Test that content is being cached 9 | // Initial get 10 | function testCache(uri) { 11 | http.get(HTTP + uri) 12 | assert(http.status == 200) 13 | let resp = deserialize(http.response) 14 | let first = resp.number 15 | 16 | // Second get, should get the same content (number must not change) 17 | http.get(HTTP + uri) 18 | assert(http.status == 200) 19 | resp = deserialize(http.response) 20 | assert(resp.number == first) 21 | http.close() 22 | } 23 | 24 | if (App.config.bit_php) { 25 | testCache("/combined/cache.php") 26 | } 27 | if (App.config.bit_esp) { 28 | testCache("/combined/cache.esp") 29 | } 30 | if (App.config.bit_ejscript) { 31 | testCache("/combined/cache.ejs") 32 | } 33 | if (App.config.bit_cgi) { 34 | testCache("/combined/cache.cgi") 35 | } 36 | 37 | -------------------------------------------------------------------------------- /test/caching/limits.tst: -------------------------------------------------------------------------------- 1 | /* 2 | limits.tst - Test caching limits 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Get a document that will normally require chunking 9 | http.get(HTTP + "/app/cache/huge") 10 | assert(http.status == 200) 11 | assert(http.header("Transfer-Encoding") == "chunked") 12 | assert(!http.header("Content-Length")) 13 | assert(http.response.contains("Line: 09999 aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd<br/>")) 14 | 15 | // Because of the LimitCacheItem, huge won't be cached, 16 | http.get(HTTP + "/app/cache/huge") 17 | assert(http.status == 200) 18 | assert(http.header("Transfer-Encoding") == "chunked") 19 | assert(!http.header("Content-Length")) 20 | assert(http.response.contains("Line: 09999 aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd<br/>")) 21 | 22 | http.close() 23 | -------------------------------------------------------------------------------- /test/caching/methods.tst: -------------------------------------------------------------------------------- 1 | /* 2 | methods.tst - Test cache matching by method 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | /* 8 | Fetch twice and test if caching is working 9 | */ 10 | function cached(method, uri): Boolean { 11 | let http: Http = new Http 12 | 13 | // Clear cache 14 | http.setHeader("Cache-Control", "no-cache") 15 | http.connect(method, HTTP + uri) 16 | http.wait() 17 | 18 | // First fetch 19 | http.connect(method, HTTP + uri) 20 | assert(http.status == 200) 21 | let resp = deserialize(http.response) 22 | let first = resp.number 23 | 24 | // Second fetch 25 | http.connect(method, HTTP + uri) 26 | assert(http.status == 200) 27 | resp = deserialize(http.response) 28 | http.close() 29 | return (resp.number == first) 30 | } 31 | 32 | if (App.config.bit_esp) { 33 | // The POST requst should be cached and the GET not 34 | assert(cached("POST", "/methods/cache.esp")) 35 | assert(!cached("GET", "/methods/cache.esp")) 36 | } 37 | 38 | -------------------------------------------------------------------------------- /test/caching/test.setup: -------------------------------------------------------------------------------- 1 | if (!App.config.bit_esp) { 2 | test.skip("ESP not enabled") 3 | } else if (test.cross) { 4 | // Enable when esp command can pre-compile and route each request 5 | test.skip("Skip if cross compiling") 6 | } 7 | -------------------------------------------------------------------------------- /test/caching/types.tst: -------------------------------------------------------------------------------- 1 | /* 2 | types.tst - Test cache matching by mime type of the file extension 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | /* 9 | Fetch twice and see if caching is working 10 | */ 11 | function cached(uri): Boolean { 12 | http.get(HTTP + uri) 13 | assert(http.status == 200) 14 | let resp = deserialize(http.response) 15 | let first = resp.number 16 | 17 | http.get(HTTP + uri) 18 | assert(http.status == 200) 19 | resp = deserialize(http.response) 20 | http.close() 21 | return (resp.number == first) 22 | } 23 | 24 | // The php request should be cached and the esp should not 25 | // The route is configured to cache: Cache server types="application/x-php" 26 | if (App.config.bit_php) { 27 | assert(cached("/types/cache.php")) 28 | } 29 | if (App.config.bit_esp) { 30 | assert(!cached("/types/cache.esp")) 31 | } 32 | -------------------------------------------------------------------------------- /test/cgi-bin/.dummy: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/cmd/test.dat: -------------------------------------------------------------------------------- 1 | Test data: Thu Sep 17 20:17:22 PDT 2009 2 | -------------------------------------------------------------------------------- /test/compress/gzip.tst: -------------------------------------------------------------------------------- 1 | /* 2 | gzip.tst - Compressed content 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Accept a gzip encoding if present 9 | http.setHeader("Accept-Encoding", "gzip") 10 | http.get(HTTP + "/compress/compressed.txt") 11 | assert(http.status == 200) 12 | -------------------------------------------------------------------------------- /test/ejs/multiple.tst: -------------------------------------------------------------------------------- 1 | /* 2 | multiple.tst -- Multiple overlapped requests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | var nap: Http = new Http 8 | 9 | // Issue a nap request. This request takes 2 seconds to complete -- waited on below. 10 | nap.get(HTTP + "/nap.ejs") 11 | 12 | 13 | // Overlapped non-blocking request 14 | var http: Http = new Http 15 | for (i in 20) { 16 | let now = new Date() 17 | http.get(HTTP + "/index.ejs") 18 | assert(http.status == 200) 19 | assert(now.elapsed < 2000) 20 | } 21 | http.close() 22 | 23 | 24 | // Wait for nap request 25 | assert(nap.status == 200) 26 | nap.close() 27 | -------------------------------------------------------------------------------- /test/ejs/session.tst: -------------------------------------------------------------------------------- 1 | /* 2 | session.tst -- Test sessions 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | var http: Http = new Http 8 | 9 | // Create a session cookie 10 | http.get(HTTP + "/session.ejs") 11 | assert(http.status == 200) 12 | let cookie = http.sessionCookie 13 | assert(http.response.trim() == "") 14 | http.close() 15 | 16 | 17 | // Issue a request with the cookie to pick up the value set in session.ejs 18 | http.setCookie(cookie) 19 | http.get(HTTP + "/session.ejs") 20 | assert(http.response.trim() == "77") 21 | -------------------------------------------------------------------------------- /test/ejs/single.tst: -------------------------------------------------------------------------------- 1 | /* 2 | single.tst -- Single non blocking request 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | var http: Http = new Http 8 | 9 | http.get(HTTP + "/index.ejs") 10 | assert(http.status == 200) 11 | http.close() 12 | -------------------------------------------------------------------------------- /test/ejs/test.setup: -------------------------------------------------------------------------------- 1 | if (!App.config.bit_ejscript) { 2 | test.skip("Ejscript not enabled") 3 | } 4 | -------------------------------------------------------------------------------- /test/error/errordoc.tst: -------------------------------------------------------------------------------- 1 | /* 2 | errordoc.tst - Test Error Documents 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | 9 | // Standard error messages 10 | http.get(HTTP + "/wont-be-there.html") 11 | assert(http.status == 404) 12 | assert(http.response.contains("Access Error: 404 -- Not Found")) 13 | http.close() 14 | 15 | // Error doc (without redirection) 16 | http.get(HTTP + "/error/also-wont-be-there.html") 17 | assert(http.status == 301) 18 | assert(http.response.contains("<title>Moved Permanently")) 19 | http.close() 20 | 21 | http = new Http 22 | http.followRedirects = true 23 | http.get(HTTP + "/error/also-wont-be-there.html") 24 | assert(http.status == 200) 25 | assert(http.response.contains("Bad luck - Can't find that document")) 26 | http.close() 27 | -------------------------------------------------------------------------------- /test/esp/big.tst: -------------------------------------------------------------------------------- 1 | /* 2 | big.tst - Various Http read tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Test http.read() into a byte array 9 | http.get(HTTP + "/big.esp") 10 | buf = new ByteArray 11 | count = 0 12 | while (http.read(buf) > 0) { 13 | count += buf.length 14 | } 15 | if (count != 62401) { 16 | print("COUNT IS " + count + " code " + http.status) 17 | } 18 | assert(count == 62401) 19 | http.close() 20 | -------------------------------------------------------------------------------- /test/esp/directives.tst: -------------------------------------------------------------------------------- 1 | /* 2 | directives.tst - Test various ESP directives 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Output should look like: 9 | // 10 | // 11 | // 12 | // ESP Directives 13 | // 14 | // 15 | //

ESP Directives

16 | // Today's Message: Hello World 17 | // Luck Number: 42 18 | // Hostname: local.magnetar.local 19 | // Time: Wed Jul 27 2011 09:53:29 GMT-0700 (PDT) 20 | // Formatted number: 12,345,678 21 | // Safe Strings: <html> 22 | // 23 | // 24 | 25 | http.get(HTTP + "/directives.esp?weather=sunny&exploit=") 26 | assert(http.status == 200) 27 | let r = http.response 28 | assert(r.contains("ESP Directives")) 29 | assert(r.contains("ESP Directives")) 30 | assert(r.contains("Today's Message: Hello World")) 31 | assert(r.contains("Lucky Number: 42")) 32 | assert(r.contains("Formatted Number: 12,345,678")) 33 | assert(r.contains("Safe Strings: <bold>")) 34 | assert(r.contains("Safe Variables: <html>")) 35 | assert(r.contains("Weather: sunny")) 36 | http.close() 37 | -------------------------------------------------------------------------------- /test/esp/get.tst: -------------------------------------------------------------------------------- 1 | /* 2 | get.tst - ESP GET tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Basic get. Validate response code and contents 9 | http.get(HTTP + "/test.esp") 10 | assert(http.status == 200) 11 | assert(http.response.contains("ESP Test Program")) 12 | 13 | /* When running in test, the name may be appweb or forAppwebTest */ 14 | assert(http.response.contains("Product Name")) 15 | http.close() 16 | 17 | if (App.test.os == "WIN") { 18 | http.get(HTTP + "/teST.eSP") 19 | assert(http.status == 200) 20 | http.close() 21 | } 22 | -------------------------------------------------------------------------------- /test/esp/include.tst: -------------------------------------------------------------------------------- 1 | /* 2 | include.tst - ESP include directives 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Basic get. Validate response code and contents 9 | http.get(HTTP + "/outer.esp") 10 | assert(http.status == 200) 11 | assert(http.response.contains("Hello from inner text")) 12 | http.close() 13 | -------------------------------------------------------------------------------- /test/esp/mvc.tst: -------------------------------------------------------------------------------- 1 | /* 2 | mvc.tst - ESP MVC tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // /app 9 | http.get(HTTP + "/app") 10 | assert(http.status == 200) 11 | assert(http.response.contains("Welcome to ESP")) 12 | http.close() 13 | 14 | // /app/ 15 | http.get(HTTP + "/app/") 16 | assert(http.status == 200) 17 | assert(http.response.contains("Welcome to ESP")) 18 | http.close() 19 | 20 | // /app/static/layout.css 21 | http.get(HTTP + "/app/static/layout.css") 22 | assert(http.status == 200) 23 | assert(http.response.contains("Default layout style sheet")) 24 | http.close() 25 | 26 | // /app/static/index.esp 27 | http.get(HTTP + "/app/static/index.esp") 28 | assert(http.status == 200) 29 | assert(http.response.contains("Welcome to ESP")) 30 | http.close() 31 | 32 | // /app/test/check - this tests a controller without view 33 | http.post(HTTP + "/app/test/check") 34 | assert(http.status == 200) 35 | assert(http.response.contains("Check: OK")) 36 | 37 | // /app/test/details - this tests templates 38 | http.post(HTTP + "/app/test/details") 39 | assert(http.status == 200) 40 | assert(http.response.contains("Test App")) 41 | assert(http.response.contains("Powered by Appweb")) 42 | assert(http.response.contains("SECRET: 42")) 43 | http.close() 44 | -------------------------------------------------------------------------------- /test/esp/redirect.tst: -------------------------------------------------------------------------------- 1 | /* 2 | redirect.tst - ESP redirection tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // This will not follow redirects 9 | http.get(HTTP + "/redirect.esp") 10 | http.followRedirects = false 11 | assert(http.status == 302) 12 | assert(http.response.contains("

Moved Temporarily

")) 13 | http.close() 14 | 15 | // This will do a transparent redirect to index.esp 16 | http.followRedirects = true 17 | http.get(HTTP + "/redirect.esp") 18 | assert(http.status == 200) 19 | assert(http.response.contains("Greetings: Hello Home Page")) 20 | http.close() 21 | -------------------------------------------------------------------------------- /test/esp/reload.tst: -------------------------------------------------------------------------------- 1 | /* 2 | reload.tst - ESP reload tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_debug && !test.cross) { 9 | // First get 10 | let path = new Path("../web/reload.esp") 11 | path.write('<% espRender(conn, "First", -1); %>') 12 | http.get(HTTP + "/reload.esp") 13 | assert(http.status == 200) 14 | assert(http.response.contains("First")) 15 | http.close() 16 | 17 | // To ensure all file system record a different mtime for the file 18 | App.sleep(1100); 19 | 20 | // Create a new file and do a second get 21 | path.write('<% espRender(conn, "Second", -1); %>') 22 | http.get(HTTP + "/reload.esp") 23 | assert(http.status == 200) 24 | assert(http.response.contains("Second")) 25 | http.close() 26 | 27 | path.remove() 28 | 29 | } else { 30 | test.skip("Run only in debug builds") 31 | } 32 | -------------------------------------------------------------------------------- /test/esp/test.setup: -------------------------------------------------------------------------------- 1 | if (!App.config.bit_esp) { 2 | test.skip("Run only if ESP enabled") 3 | } 4 | -------------------------------------------------------------------------------- /test/esp/xname.tst: -------------------------------------------------------------------------------- 1 | /* 2 | xname.tst - ESP get with .xesp extension 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (!test.cross) { 9 | http.get(HTTP + "/test.xesp") 10 | assert(http.status == 200) 11 | } else { 12 | test.skip("Disabled if cross-compiling") 13 | } 14 | -------------------------------------------------------------------------------- /test/ipv6/getv6.tst: -------------------------------------------------------------------------------- 1 | /* 2 | getv6.tst - IPv6 GET tests 3 | */ 4 | 5 | const HTTP = App.config.ipv6 || "[::1]:4113" 6 | let http: Http = new Http 7 | 8 | // Basic get. Validate response code and contents 9 | http.get(HTTP + "/index.html") 10 | assert(http.status == 200) 11 | // assert(http.readString().contains("Hello")) 12 | 13 | // Validate get contents 14 | http.get(HTTP + "/index.html") 15 | assert(http.readString(12) == "") 16 | assert(http.readString(7) == "") 17 | 18 | // Validate get contents 19 | http.get(HTTP + "/index.html") 20 | assert(http.response.endsWith("</html>\n")) 21 | assert(http.response.endsWith("</html>\n")) 22 | 23 | // Test Get with a body. Yes this is valid Http, although unusual. 24 | http.get(HTTP + "/index.html", 'name=John&address=700+Park+Ave') 25 | assert(http.status == 200) 26 | -------------------------------------------------------------------------------- /test/ipv6/test.setup: -------------------------------------------------------------------------------- 1 | if (!App.config.uris.ipv6) { 2 | test.skip("Run only if IPv6 supported") 3 | } 4 | -------------------------------------------------------------------------------- /test/lang/default.tst: -------------------------------------------------------------------------------- 1 | /* 2 | default.tst - Test DefaultLanguage 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // http.setHeader("Accept-Language", "en") 9 | http.get(HTTP + "/lang/default/index.html") 10 | assert(http.status == 200) 11 | assert(http.readString().contains("Bonjour")) 12 | -------------------------------------------------------------------------------- /test/lang/root.tst: -------------------------------------------------------------------------------- 1 | /* 2 | root.tst - Test AddLanguageRoot 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.setHeader("Accept-Language", "en-US,en;q=0.8") 9 | http.get(HTTP + "/lang/root/eng.html") 10 | assert(http.status == 200) 11 | assert(http.readString().contains("Hello English")) 12 | -------------------------------------------------------------------------------- /test/lang/suffix.tst: -------------------------------------------------------------------------------- 1 | /* 2 | suffix.tst - Test AddLanguage 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.setHeader("Accept-Language", "en") 9 | http.get(HTTP + "/lang/suffix/index.html") 10 | assert(http.status == 200) 11 | assert(http.readString().contains("English Suffix")) 12 | -------------------------------------------------------------------------------- /test/lang/target.tst: -------------------------------------------------------------------------------- 1 | /* 2 | target.tst - Test AddLanguage 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.setHeader("Accept-Language", "en") 9 | http.get(HTTP + "/lang/target/index.html") 10 | assert(http.status == 200) 11 | assert(http.readString().contains("English Suffix")) 12 | -------------------------------------------------------------------------------- /test/limits/get.t: -------------------------------------------------------------------------------- 1 | /* 2 | get.tst - Extreme GET tests 3 | */ 4 | 5 | // TODO - should be able to have a module test.http.get 6 | // MOB - incomplete 7 | module test.http.getmethod { 8 | 9 | const HTTP = App.config.main || "127.0.0.1:4100" 10 | const URL = HTTP + "/index.html" 11 | const BIG = HTTP + "/big.ejs" 12 | 13 | let http: Http = new Http 14 | 15 | print("DEPTH " + test.depth) 16 | for (iter in test.depth) { 17 | url = URL + "?" 18 | for (i in 2000 * (iter + 1)) { 19 | url += + "key" + i + "=" + Date().now() + "&" 20 | } 21 | url = url.trim("&") 22 | http = new Http 23 | print(url.length) 24 | http.get(url) 25 | print(http.status) 26 | print(http.response) 27 | assert(http.status == 200) 28 | assert(http.response.contains("Hello")) 29 | break 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/listing/dirlist.tst: -------------------------------------------------------------------------------- 1 | /* 2 | dirlist.tst - Directory listings 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let http: Http = new Http 8 | 9 | if (App.config.dir) { 10 | http.get(HTTP + "/listing/") 11 | assert(http.status == 200) 12 | } 13 | -------------------------------------------------------------------------------- /test/range/ranges.tst: -------------------------------------------------------------------------------- 1 | /* 2 | ranges.tst - Ranged get tests 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | 9 | // Get first 5 bytes 10 | http.setHeader("Range", "bytes=0-4") 11 | http.get(HTTP + "/big.txt") 12 | assert(http.status == 206) 13 | assert(http.response == "01234") 14 | http.close() 15 | 16 | 17 | // Get last 5 bytes 18 | http.setHeader("Range", "bytes=-5") 19 | http.get(HTTP + "/big.txt") 20 | assert(http.status == 206) 21 | assert(http.response.trim() == "MENT") 22 | http.close() 23 | 24 | 25 | // Get from specific position till the end 26 | http.setHeader("Range", "bytes=117000-") 27 | http.get(HTTP + "/big.txt") 28 | assert(http.status == 206) 29 | assert(http.response.trim() == "END OF DOCUMENT") 30 | http.close() 31 | 32 | 33 | // Multiple ranges 34 | http.setHeader("Range", "bytes=0-5,25-30,-5") 35 | http.get(HTTP + "/big.txt") 36 | assert(http.status == 206) 37 | assert(http.response.contains("Content-Range: bytes 0-5/117016")) 38 | assert(http.response.contains("Content-Range: bytes 25-30/117016")) 39 | assert(http.response.contains("Content-Range: bytes 117011-117015/117016")) 40 | assert(http.response.contains("012345")) 41 | assert(http.response.contains("567890")) 42 | assert(http.response.contains("MENT")) 43 | http.close() 44 | -------------------------------------------------------------------------------- /test/redirect/redirect.tst: -------------------------------------------------------------------------------- 1 | /* 2 | redirect.tst - Redirect directive 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | 9 | // Standard error messages 10 | http.get(HTTP + "/old.html") 11 | assert(http.status == 302) 12 | assert(http.response.contains("<h1>Moved Temporarily</h1>")) 13 | http.close() 14 | 15 | http = new Http 16 | http.followRedirects = true 17 | http.get(HTTP + "/old/html") 18 | assert(http.status == 200) 19 | assert(http.response.contains("<title>index.html")) 20 | http.close() 21 | 22 | http = new Http 23 | http.get(HTTP + "/membersOnly") 24 | assert(http.status == 410) 25 | assert(http.response.contains("Length Required")) 26 | http.close() 27 | 28 | -------------------------------------------------------------------------------- /test/regress/01000-chunk.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/regress/01000-chunk.dat -------------------------------------------------------------------------------- /test/regress/01000-chunk.tst: -------------------------------------------------------------------------------- 1 | /* 2 | 01000-chunk.tst - This tests uploading 3 files using chunked encoding as well. 3 | Was failing due to the trailing "\r\n" in the upload content 4 | */ 5 | 6 | let nc 7 | try { nc = Cmd.sh("which nc"); } catch {} 8 | 9 | if (App.test.depth > 0 && nc && Config.OS != "windows" && App.config.bit_ejscript) { 10 | const HTTP = Uri(App.config.uris.http || "127.0.0.1:4100") 11 | let ip = HTTP.host 12 | let port = HTTP.port 13 | 14 | Cmd.sh("cat 01000-chunk.dat | nc " + ip + " " + port); 15 | Cmd.sh("cc -o tcp tcp.c") 16 | if (Config.OS == "windows") { 17 | Cmd.sh("./tcp.exe " + ip + " " + port + " 01000-chunk.dat") 18 | } else { 19 | Cmd.sh("./tcp " + ip + " " + port + " 01000-chunk.dat") 20 | } 21 | 22 | } else { 23 | test.skip("Test requires ejscript, nc and depth >= 1") 24 | } 25 | -------------------------------------------------------------------------------- /test/route/auth.tst: -------------------------------------------------------------------------------- 1 | /* 2 | auth.tst - Test authorized condition 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.get(HTTP + "/route/auth/basic.html") 9 | assert(http.status == 401) 10 | -------------------------------------------------------------------------------- /test/route/cmd.tst: -------------------------------------------------------------------------------- 1 | /* 2 | cmd.tst - Test Update cmd 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Run a command that creates ../route-update-cmd.tmp 9 | 10 | if (test.hostOs != "VXWORKS" && test.hostOs != "WIN") { 11 | let path = Path("../route-update-cmd.tmp") 12 | path.remove() 13 | assert(!path.exists) 14 | 15 | http.get(HTTP + "/route/update/cmd") 16 | assert(http.status == 200) 17 | assert(http.response == "UPDATED") 18 | assert(path.exists) 19 | assert(path.remove()) 20 | http.close() 21 | } 22 | -------------------------------------------------------------------------------- /test/route/condition.tst: -------------------------------------------------------------------------------- 1 | /* 2 | condition.tst - Test conditions 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.get(HTTP + "/route/cond") 9 | assert(http.status == 200) 10 | assert(http.response == "http") 11 | -------------------------------------------------------------------------------- /test/route/fullpat.tst: -------------------------------------------------------------------------------- 1 | /* 2 | fullpat.tst - Test pattern matching features 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Test route-01 ^/route/(user|admin)/{action}/[^a-z]\{2}(\.[hH][tT][mM][lL])$> 9 | http.get(HTTP + "/route/user/login/AA.html") 10 | assert(http.status == 200) 11 | assert(http.response == "user") 12 | 13 | http.get(HTTP + "/route/user/login/aA.html") 14 | assert(http.status == 404) 15 | -------------------------------------------------------------------------------- /test/route/missing.tst: -------------------------------------------------------------------------------- 1 | /* 2 | missing.tst - Add extension 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | if (App.config.bit_php) { 9 | http.get(HTTP + "/route/missing-ext/index") 10 | assert(http.status == 200) 11 | assert(http.response.contains("Hello PHP World")) 12 | } else { 13 | test.skip("PHP not enabled") 14 | } 15 | -------------------------------------------------------------------------------- /test/route/optional.tst: -------------------------------------------------------------------------------- 1 | /* 2 | optional.tst - Test optional tokens 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Route: ^/optional/{controller}(~/{action}~) 9 | 10 | // Test just a controller 11 | http.get(HTTP + "/route/optional/user") 12 | assert(http.status == 200) 13 | assert(http.response == "user-") 14 | 15 | // With trailing "/" 16 | http.get(HTTP + "/route/optional/user/") 17 | assert(http.status == 200) 18 | assert(http.response == "user-") 19 | 20 | // Test controller/action 21 | http.get(HTTP + "/route/optional/user/login") 22 | assert(http.status == 200) 23 | assert(http.response == "user-login") 24 | -------------------------------------------------------------------------------- /test/route/param.tst: -------------------------------------------------------------------------------- 1 | /* 2 | param.tst - Test match by param 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | // Should fail 9 | http.get(HTTP + "/route/param?name=ralph") 10 | assert(http.status == 404) 11 | http.close() 12 | 13 | http.get(HTTP + "/route/param?name=peter") 14 | assert(http.status == 200) 15 | assert(http.response == "peter") 16 | http.close() 17 | 18 | // Should fail 19 | http.form(HTTP + "/route/param", {name: "ralph"}) 20 | assert(http.status == 404) 21 | http.close() 22 | 23 | http.form(HTTP + "/route/param", {name: "peter"}) 24 | assert(http.status == 200) 25 | assert(http.response == "peter") 26 | http.close() 27 | -------------------------------------------------------------------------------- /test/route/token.tst: -------------------------------------------------------------------------------- 1 | /* 2 | token.tst - Test tokenized parameters 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.get(HTTP + "/route/tokens/login?fast") 9 | assert(http.status == 200) 10 | assert(http.response == "login-fast") 11 | -------------------------------------------------------------------------------- /test/route/var.tst: -------------------------------------------------------------------------------- 1 | /* 2 | var.tst - Test Update var 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.setHeader("From", "Mars") 9 | http.get(HTTP + "/route/update/var") 10 | 11 | assert(http.status == 200) 12 | assert(http.response == "Mars") 13 | http.close() 14 | -------------------------------------------------------------------------------- /test/security/dos.tst: -------------------------------------------------------------------------------- 1 | /* 2 | Denial of service testing 3 | */ 4 | 5 | const HTTP: Uri = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | // Check server available 8 | http = new Http 9 | http.get(HTTP + "/index.html") 10 | assert(http.status == 200) 11 | http.close() 12 | 13 | // MOB - TEMP 14 | if (Config.OS != 'windows') { 15 | // Try to crash with DOS attack 16 | for (i in 2000) { 17 | let s = new Socket 18 | try { 19 | s.connect(HTTP.address) 20 | } catch (e) { 21 | print("ERROR", i) 22 | print(e) 23 | throw e 24 | } 25 | let written = s.write("Any Text") 26 | assert(written == 8) 27 | s.close() 28 | } 29 | } 30 | 31 | // Check server still there 32 | http = new Http 33 | http.get(HTTP + "/index.html") 34 | assert(http.status == 200) 35 | http.close() 36 | -------------------------------------------------------------------------------- /test/security/huge-uri.tst: -------------------------------------------------------------------------------- 1 | /* 2 | Very large URI test (3MB) 3 | */ 4 | const HTTP: Uri = App.config.uris.http || "127.0.0.1:4100" 5 | 6 | // This writes a ~100K URI. LimitUri should be less than 100K for this unit test. 7 | 8 | let data = "/" 9 | for (i in 1000) { 10 | data += "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678\n" 11 | } 12 | 13 | /* 14 | Test LimitUri 15 | */ 16 | let s = new Socket 17 | s.connect(HTTP.address) 18 | let count = 0 19 | try { 20 | count += s.write("GET ") 21 | count += s.write(data) 22 | count += s.write(" HTTP/1.1\r\n\r\n") 23 | } catch { 24 | App.log.error("Write failed. Wrote " + count + " of " + data.length + " bytes.") 25 | // Check appweb.conf LimitRequestHeader. This must be sufficient to accept the write the header. 26 | } 27 | 28 | /* Server should just close the connection without a response */ 29 | response = new ByteArray 30 | while ((n = s.read(response, -1)) != null ) {} 31 | assert(response.toString() == '') 32 | s.close() 33 | 34 | // Check server still up 35 | http = new Http 36 | http.get(HTTP + "/index.html") 37 | assert(http.status == 200) 38 | http.close() 39 | -------------------------------------------------------------------------------- /test/ssl/matrixssl.tst: -------------------------------------------------------------------------------- 1 | /* 2 | matrixssl.tst - Matrixssl tests 3 | */ 4 | 5 | if (!Config.SSL) { 6 | test.skip("SSL not enabled in ejs") 7 | 8 | } else if (App.config.bit_matrixssl) { 9 | const HTTPS = App.config.uris.matrixssl || "https://127.0.0.1:4210" 10 | let http: Http = new Http 11 | 12 | /* 13 | With keep alive 14 | */ 15 | http.verify = false 16 | for (i in 110) { 17 | http.get(HTTPS + "/index.html") 18 | assert(http.status == 200) 19 | assert(http.response) 20 | http.reset() 21 | } 22 | http.close() 23 | 24 | /* 25 | With-out keep alive 26 | */ 27 | for (i in 50) { 28 | http.verify = false 29 | http.get(HTTPS + "/index.html") 30 | assert(http.status == 200) 31 | assert(http.response) 32 | http.close() 33 | } 34 | 35 | } else { 36 | test.skip("SSL not enabled") 37 | } 38 | -------------------------------------------------------------------------------- /test/ssl/repeat.tst: -------------------------------------------------------------------------------- 1 | /* 2 | repeat.tst - Repeated SSL http tests 3 | */ 4 | 5 | if (!Config.SSL) { 6 | test.skip("SSL not enabled in ejs") 7 | 8 | } else if (App.config.bit_ssl) { 9 | const HTTPS = App.config.uris.ssl || "https://127.0.0.1:4110" 10 | let http: Http = new Http 11 | 12 | /* 13 | With keep alive 14 | */ 15 | http.verify = false 16 | for (i in 110) { 17 | http.get(HTTPS + "/index.html") 18 | assert(http.status == 200) 19 | assert(http.response) 20 | http.reset() 21 | } 22 | http.close() 23 | 24 | /* 25 | With-out keep alive 26 | */ 27 | for (i in 50) { 28 | http.verify = false 29 | http.get(HTTPS + "/index.html") 30 | assert(http.status == 200) 31 | assert(http.response) 32 | http.close() 33 | } 34 | 35 | } else { 36 | test.skip("SSL not enabled") 37 | } 38 | -------------------------------------------------------------------------------- /test/sslconf/ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICszCCAhwCCQDkklKhZFxcQTANBgkqhkiG9w0BAQQFADCBnTELMAkGA1UEBhMC 3 | VVMxEzARBgNVBAgTCldhc2hpbmd0b24xETAPBgNVBAcTCEJlbGxldnVlMRUwEwYD 4 | VQQKEwxFeGFtcGxlIEluYy4xEzARBgNVBAsTClByb2R1Y3Rpb24xGDAWBgNVBAMT 5 | D3d3dy5leGFtcGxlLmNvbTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5j 6 | b20wHhcNMTIwNzA1MjE0NzE3WhcNMTIwODA0MjE0NzE3WjCBnTELMAkGA1UEBhMC 7 | VVMxEzARBgNVBAgTCldhc2hpbmd0b24xETAPBgNVBAcTCEJlbGxldnVlMRUwEwYD 8 | VQQKEwxFeGFtcGxlIEluYy4xEzARBgNVBAsTClByb2R1Y3Rpb24xGDAWBgNVBAMT 9 | D3d3dy5leGFtcGxlLmNvbTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5j 10 | b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOxVECxRnMA+EK/FzM3MCvOI 11 | NzQ5aVStnglyvDjNiLWGkJr+lUlupsZbYhEJ4aqJn+ldFKTPvrr4AGp8TojQ5CBW 12 | x16WP2n/pe+47Ng2K/wNq4WoxSC4vsHMoFIa1oH5cp0Az/+Mei0pzKrGUKKIjB4y 13 | 9UMOft9t5aFl0+nNn/PFAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAZcNbBPkFQrzE 14 | 1Ex//CHJbr2GCaWbQRk+pkiQZ0bK5G2K2LY8/Cg8nIUavKNcDx9gi0QGT6xfZrSg 15 | qhCmUj9aVbeUjcMZSU9Dcqk/EIWFMcwZLRPu7LaxUt1hp/XBTMNb3/wwrAMAvwQ0 16 | rB+KvXFJK2JZSICm3QogD7BtcE/MgOo= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /test/sslconf/ca.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,B31C168018873BAC 4 | 5 | BXhfc7ueY7eYQUrsLErdTu8JNPjvk1A3TvTxKX9S0wo3xhH1hlF65cE5rdGTdHHh 6 | uCpA1TNpEmTHbXaGA5FxiNTI+Y6AMXYsh5+Ehq+Hr2wMBAYzusMqk0XGXABwrWlN 7 | x3aXRv7GcvuyVHwHgChbchL7/rdrXS2PuqgLJ8DzqMe2bwY44+Q7qg/w1cmdn0kP 8 | vnmEM/qKJx1hHdt6fWDebgh27n1Ai730Lu5eZEfE1wiHjXO5gFTBLyBLQMN2dwNr 9 | d0qbZ36JSDCJatvCNkADmvfvGomRxorqXrswbZ+RpQ4cTc6HBfJDiA3yz4+gCeFD 10 | cKvpWMqialrZDYgIpOY7A0ZP554Brd5+p5Nabt4qW+LFDgeNbcHDY6Q1z01JWwvV 11 | ydxj46S42nnVy0HypBIDASDHI7K9yLK8v1k7UT7ngz4fK9eVFZmy8nmcZo4LHuoM 12 | bg9bhBonrG5zh6AfBsSf76/5YYPnogQh5XwGqywOGmax9ExzQe6MxMmyFIU6gNt3 13 | MpQE5qGI+9/RBB2imgPSrTxYJ/FA/DubUQfVMjDFQ0AdwbAaB4TZOkcAbBqnHKPC 14 | vx7KKaPHYPAzx3EVkFLIESQsvPqiAzaqvNgQ5xI0keyvMwuFofVzDSIosHvBskBu 15 | VrUmCkJCl198vWQwdV07yNjoc2WoivkYu607DEfUfuG7V1C0IBiARqEfVHbou+Oh 16 | 0c23jRYr2P1NZa09eeiTwo6msbYmalmO0QuRKfRdbL98rYrSAihZ+obwK3I7Rh9Y 17 | NxAmEXFAZZsm8+N72M956G0qlBOXv6atSSWz2Lwsm2fNxc0VWDBfUg== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /test/sslconf/ca.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQDsVRAsUZzAPhCvxczNzArziDc0OWlUrZ4Jcrw4zYi1hpCa/pVJ 3 | bqbGW2IRCeGqiZ/pXRSkz766+ABqfE6I0OQgVsdelj9p/6XvuOzYNiv8DauFqMUg 4 | uL7BzKBSGtaB+XKdAM//jHotKcyqxlCiiIweMvVDDn7fbeWhZdPpzZ/zxQIDAQAB 5 | AoGASyTI3a6dbqrNV3ZHJnBoUwLOurY+fYQuqcZnfpArlbxRolasVQrv0EYiKlTA 6 | Ah98TxEfjT/Y304Xo8QenHX+8oT16I7lNouYWSeZALS4b1aJsESdOaB/OsHbit9e 7 | 9jH40Z7l1q0caN6YzO9wRNVbMW7gBJKElQoo/6/0XGyWNEkCQQD5iGBtpgQsz+e0 8 | r6lNhAFUdjrsaBxMH9ViakTBEC01j11QMl5tcvFsx+E7gFKMeTQZmVrifsAUE9YW 9 | 85ioXL+vAkEA8nUaWwuVbmfMgepHVdVcQaKxx95aeT1QZ0iYCjeuHdo2O9a8h7v/ 10 | rPpsnRqcO0TU/f6FcOgSyUVTlsTXrpRMywJBALRLDSEsaqfWMBwlL7aKQku8gSZ+ 11 | srNt7MeG8NZt0bx5MXrYadG60yU95kcPmJVWnYZBf6FW44GeM3mx2AMNwJECQE9q 12 | H9nWb3mcMhYTgI4StochHQ4UPJodhSpvUq12E2ffw4fSDCqBX3tvAwhqYOXg48rW 13 | BSs4OH8IYBqwGt0p4gUCQQDdgvvGiAcAO0N+6+9ppXc16/1sgFgVaY8sxlL6L/c7 14 | UZZzhgaKg1He/1LnBAQUh5KzEwDVOf08h0zhzil8D9Tg 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /test/sslconf/response.client: -------------------------------------------------------------------------------- 1 | US 2 | Washington 3 | Bellevue 4 | Client Connections Inc 5 | Production 6 | localhost 7 | info@clientconnections.com 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/sslconf/response.server: -------------------------------------------------------------------------------- 1 | US 2 | Washington 3 | Bellevue 4 | Embedthis Software Inc. 5 | Development 6 | localhost 7 | dev@embedthis.com 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/sslconf/response.yes: -------------------------------------------------------------------------------- 1 | y 2 | y 3 | -------------------------------------------------------------------------------- /test/sslconf/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,6FAF45F5EF9F1DB6 4 | 5 | YLudObpNng9Cf1H+gAgSvS0jUje6wKw7k2yLdMt4jaKpG5IoCJ3qbZFWCal7ztqw 6 | GIf0RQfDuXAuaqHEwIKDzYRPagljjReoeOxsrK7na6MvcM9TMZDuLoEo/BZ4y2T6 7 | YoHiwPJaeM7NotO4kXVrcSK1pcy2jPoAqW9o0zD55jyFgVG0E1LWAkSG4yaUmtPR 8 | BiQn0kB4mFzAq9gQ7D6XsiD7rERKXt0tVDHw/ZTlNDKYBq1svwoH7FIaiMX4lKJw 9 | ISCOPj4VvzxaVQSCB1s8TAd7N0lTLXSwlILeHYPe2dp1YMdLXeWSqGyce9hdjAJt 10 | tFVvgipquN7wjWqtPpxrwFVOgJZ64lle2D6g+X+E711n5w+bK51vYH+mcA020gNF 11 | /FLOOzPFBTN1A1VaS2tBFuoPgohH6/8FG+2hpsRuNv4V9iPdmPCQLlv+YhCQPgvB 12 | XO8xs1gbRjB7qy6dGJXvxjqNaNqvMy/XMGySPq739HrhEOCJANe8vsd7P/27DBOG 13 | NE4ePJvE6TUJ2MlQVizjo6I3ouNXNrca6BiRliZcvLd7E73UobW7GyMemjVnOW6B 14 | 58rwJikNZ6kvcT52sUdqrqhfz2cWL7pzKxcabKwbATHWjcSxjaGLdSRCBwNjyD9y 15 | wVM97r5VtnuSjFwcZ4jy5rTxfBWusXtOCqGanNoezbNOt+VfR1iGJ/QuoMhM78SG 16 | E6h70K/i1o0l+SCTYH3+/6lKnwwW1POIjf6z1X9U/VxwyS5VPI0Ry2qrnhYHEfem 17 | 5bSSyI0ckGVi/Rr7h5dpZDheqeJdMJQRkHTwiC0P7kD3S/rAGa4o/Q== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /test/sslconf/server.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQDKzkMKfbyQgarB4HQVxuX0qK2KWBEwvx/kWQeaQX/dh5/2ODlM 3 | JxKlFqpiD/CvTA22Aqp+9qT4lBIl3Dgc/CfMQVQ6QQbi47VV3sot7AR9b8bK83Zl 4 | SyOK9mWTL7vIUqmHcvFCDPrsreNcgW40EkwKWb1hHJGEkPOAJSFzWNByNQIDAQAB 5 | AoGBAJHThnlAuBngYvxNfKs7/ZXSxBY6BQJcK35yVfkhJ+QO5YKSIwETB2EVzyX7 6 | +EDUGvfJKvdoOm9TaUk39FFDLwl0LG+hozzYiqrV3GNj7zGakzAIx3E+CnjJR6wm 7 | Hm3vN0c4bNwFU8wXaHSQLMNqrvmejaYlNDO08jqaoNL5JRtxAkEA5mlfac2pAI8R 8 | 0f323y/ElIIwLLFU3iWp9xEsOuhFgMvrnodS9GhZCTw4dwYU+fiiKtLi6UbzViMa 9 | mjNScmDUGwJBAOFUDOUoltlaGFOZE+k+u+Obo/JXUTHNDuRs8v7wN0cXhwOcWEzg 10 | n3JjfulkTJm24oOqpY83vofFVqy+uhXUF+8CQE04S23eKyGw0TwbbT1neO58o0CX 11 | PeYloUzYSIaFiaWcsh6zI64duplJwXLCaw1Lsq2/d6TOzoazxRqg0KTcprkCQCIs 12 | 8VfAdEC7HX1wdkimLzEyZgdXnwUCqQOUUrbAEGJD+0Jc8DeYyhY7aQBVKhkWV/zI 13 | YRv7xHYrRB4nP2oYJRkCQB3gwdra4tDEADUQPvmeg777KnZjuTH0nqglgMOfoCUX 14 | eSfzAN6Xlq67A3IQmEtcVBvMPw1MqrAirtNDLgjsnrg= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /test/start.es: -------------------------------------------------------------------------------- 1 | /* 2 | NOT USED 3 | Optional startup script for Ejscript requests. 4 | This is referenced by appweb.conf/EjsStartup. 5 | If missing, Ejscript will use an internal, equivalent script. 6 | */ 7 | 8 | require ejs.web 9 | let server: HttpServer = new HttpServer 10 | 11 | var router = Router(Router.Top) 12 | router.show() 13 | server.on("readable", function (event, request) { 14 | server.serve(request, router) 15 | }) 16 | server.listen() 17 | -------------------------------------------------------------------------------- /test/stress/badUrl.tst: -------------------------------------------------------------------------------- 1 | /* 2 | badUrl.tst - Stress test malformed URLs 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | let http: Http = new Http 7 | 8 | http.get(HTTP + "/index\x01.html") 9 | assert(http.status == 404) 10 | assert(http.response.contains("Not Found")) 11 | http.close() 12 | -------------------------------------------------------------------------------- /test/stress/bigForm.tst: -------------------------------------------------------------------------------- 1 | /* 2 | bigForm.tst - Stress test very large form data (triggers chunking) 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | 7 | let http: Http = new Http 8 | 9 | let form = {} 10 | for (i in 10000) { 11 | form["field_" + i] = Date.ticks 12 | } 13 | 14 | http.form(HTTP + "/test.esp", form) 15 | assert(http.status == 200) 16 | assert(http.response.contains("ESP Test Program")) 17 | http.close() 18 | -------------------------------------------------------------------------------- /test/stress/bigUrl.tst: -------------------------------------------------------------------------------- 1 | /* 2 | bigUrl.tst - Stress test very long URLs 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | // const HTTP = App.config.uris.http || "vx:4100" 7 | let depth = (global.test && test.depth) || 4 8 | 9 | let http: Http = new Http 10 | 11 | // Create a very long query 12 | let queryPart = "" 13 | for (i in 100) { 14 | queryPart += + "key" + i + "=" + 1234567890 + "&" 15 | } 16 | 17 | // Vary up the query length based on the depth 18 | 19 | 20 | for (iter in depth) { 21 | let query = "" 22 | for (i in 5 * (iter + 3)) { 23 | query += queryPart + "&" 24 | } 25 | query = query.trim("&") 26 | 27 | // Test /index.html 28 | http.get(HTTP + "/index.html?" + query) 29 | assert(http.status == 200) 30 | assert(http.response.contains("Hello /index.html")) 31 | 32 | if (App.config.bit_ejscript) { 33 | // Test /index.ejs 34 | http.get(HTTP + "/index.ejs?" + query) 35 | assert(http.status == 200) 36 | assert(http.response.contains("Hello /index.ejs")) 37 | } 38 | // TODO - esp, cgi, php 39 | } 40 | http.close() 41 | -------------------------------------------------------------------------------- /test/stress/test.setup: -------------------------------------------------------------------------------- 1 | 2 | if (test.phase == "init" && test.depth == 1) { 3 | test.skip("Stress tests run at depth 2 or greater") 4 | } 5 | -------------------------------------------------------------------------------- /test/stress/upload.tst: -------------------------------------------------------------------------------- 1 | /* 2 | upload.tst - Stress test uploads 3 | */ 4 | 5 | const HTTP = App.config.uris.http || "127.0.0.1:4100" 6 | const TESTFILE = "upload-" + hashcode(self) + ".tdat" 7 | 8 | if (App.config.bit_ejscript) { 9 | 10 | let http: Http = new Http 11 | 12 | /* Depths: 0 1 2 3 4 5 6 7 8 9 */ 13 | var sizes = [ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 ] 14 | 15 | // Create test data 16 | buf = new ByteArray 17 | for (i in 64) { 18 | for (j in 15) { 19 | buf.writeByte("A".charCodeAt(0) + (j % 26)) 20 | } 21 | buf.writeByte("\n".charCodeAt(0)) 22 | } 23 | 24 | // Create test data file 25 | f = File(TESTFILE).open({mode: "w"}) 26 | for (i in (sizes[test.depth] * 1024)) { 27 | f.write(buf) 28 | } 29 | f.close() 30 | 31 | if (test.threads == 1) { 32 | size = Path(TESTFILE).size 33 | 34 | http.upload(HTTP + "/upload.ejs", { file: TESTFILE }) 35 | assert(http.status == 200) 36 | http.close() 37 | 38 | let uploaded = Path("../web/tmp").join(Path(TESTFILE).basename) 39 | assert(uploaded.size == size) 40 | Cmd.sh("diff " + uploaded + " " + TESTFILE) 41 | } 42 | Path(TESTFILE).remove() 43 | 44 | } else { 45 | test.skip("Ejscript not enabled") 46 | } 47 | -------------------------------------------------------------------------------- /test/stress/whitespace.tst: -------------------------------------------------------------------------------- 1 | /* 2 | Test various whitespace 3 | */ 4 | const HTTP: Uri = App.config.uris.http || "127.0.0.1:4100" 5 | const DELAY = 500 6 | 7 | let s 8 | let count = 0 9 | let response = new ByteArray 10 | 11 | // Leading white space 12 | s = new Socket 13 | s.connect(HTTP.address) 14 | count += s.write(" GET /index.html HTTP/1.0\r\n\r\n") 15 | assert(count > 0) 16 | for (count = 0; (n = s.read(response, -1)) != null; count += n) { } 17 | assert(response.toString().contains('200 OK')) 18 | assert(response.toString().contains('Hello /index')) 19 | s.close() 20 | 21 | 22 | // white space after method 23 | s = new Socket 24 | s.connect(HTTP.address) 25 | count += s.write("GET /index.html HTTP/1.0\r\n\r\n") 26 | assert(count > 0) 27 | for (count = 0; (n = s.read(response, -1)) != null; count += n) { } 28 | assert(response.toString().contains('200 OK')) 29 | assert(response.toString().contains('Hello /index')) 30 | s.close() 31 | 32 | // white space after URI 33 | s = new Socket 34 | s.connect(HTTP.address) 35 | count += s.write("GET /index.html HTTP/1.0\r\n\r\n") 36 | assert(count > 0) 37 | for (count = 0; (n = s.read(response, -1)) != null; count += n) { } 38 | assert(response.toString().contains('200 OK')) 39 | assert(response.toString().contains('Hello /index')) 40 | s.close() 41 | 42 | -------------------------------------------------------------------------------- /test/vxrun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # vxrun address image 4 | # 5 | 6 | ADDRESS=${1:-192.168.200.1} 7 | IMAGE=${2:-../../out/i586-wrs-vxworks/bin/appweb.out} 8 | SIM=vxsim0 9 | MEMSIZE=134217728 10 | 11 | cat >vxargs <My Documents/index.html 2 | Hello MyDocuments 3 | 4 | -------------------------------------------------------------------------------- /test/web/alias/atest.html: -------------------------------------------------------------------------------- 1 | alias/atest.html 2 | Hello /alias/atest.html 3 | 4 | -------------------------------------------------------------------------------- /test/web/alive.html: -------------------------------------------------------------------------------- 1 | ALIVE 2 | -------------------------------------------------------------------------------- /test/web/auth/basic/basic.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Test Program 4 | 5 | 6 |

ESP Test Program

7 |

Server Time: <%= mprGetDate(0) %>

8 |

Product Name: <%= mprGetAppName() %>

9 | 10 | 11 | -------------------------------------------------------------------------------- /test/web/auth/basic/basic.html: -------------------------------------------------------------------------------- 1 | 2 | ALL ACCESS 3 | Welcome to Basic - Access for all 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/basic/basic.php: -------------------------------------------------------------------------------- 1 | index.php 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/web/auth/basic/bug.ejs: -------------------------------------------------------------------------------- 1 | 2 | index.html 3 | <% request.write("Hello /index.ejs"); %> 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/basic/executive/executive.html: -------------------------------------------------------------------------------- 1 | 2 | GROUP ACCESS 3 | Welcome to Basic - Access for groups 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/basic/joshua/user.html: -------------------------------------------------------------------------------- 1 | 2 | USER ACCESS 3 | Welcome to Basic - Access for a user 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/digest/digest.html: -------------------------------------------------------------------------------- 1 | 2 | ALL ACCESS 3 | Welcome to Digest - Access for all 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/digest/executive/executive.html: -------------------------------------------------------------------------------- 1 | 2 | GROUP ACCESS 3 | Welcome to Basic - Access for groups 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/digest/joshua/user.html: -------------------------------------------------------------------------------- 1 | 2 | USER ACCESS 3 | Welcome to Basic - Access for a user 4 | 5 | -------------------------------------------------------------------------------- /test/web/auth/post/index.html: -------------------------------------------------------------------------------- 1 | index.html 2 | Hello /admin/index.html 3 | 4 |

Link to reload this page

5 |

Link to log out

6 | 7 | -------------------------------------------------------------------------------- /test/web/auth/post/login-service.esp: -------------------------------------------------------------------------------- 1 | login-service.esp 2 | 3 | <% 4 | if (smatch(conn->rx->method, "POST") && httpLogin(conn, param("username"), param("password"))) { 5 | cchar *referrer = getReferrer(); 6 | redirect(referrer ? referrer : "/index.html"); 7 | } else { 8 | redirect("/auth/post/login.esp"); 9 | } 10 | %> 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/web/auth/post/login.esp: -------------------------------------------------------------------------------- 1 | login.esp 2 | 3 |

Please log in

4 | <% setSessionVar("referrer", getReferrer()); %> 5 |
6 | Username
7 | Password
8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /test/web/bench/bench.html: -------------------------------------------------------------------------------- 1 | 0123456789012345678901234567890123456789012345678 2 | 0123456789012345678901234567890123456789012345678 3 | 0123456789012345678901234567890123456789012345678 4 | 0123456789012345678901234567890123456789012345678 5 | 0123456789012345678901234567890123456789012345678 6 | 0123456789012345678901234567890123456789012345678 7 | 0123456789012345678901234567890123456789012345678 8 | 0123456789012345678901234567890123456789012345678 9 | 0123456789012345678901234567890123456789012345678 10 | 0123456789012345678901234567890123456789012345678 11 | 0123456789012345678901234567890123456789012345678 12 | 0123456789012345678901234567890123456789012345678 13 | 0123456789012345678901234567890123456789012345678 14 | 0123456789012345678901234567890123456789012345678 15 | 0123456789012345678901234567890123456789012345678 16 | 0123456789012345678901234567890123456789012345678 17 | 0123456789012345678901234567890123456789012345678 18 | 0123456789012345678901234567890123456789012345678 19 | 0123456789012345678901234567890123456789012345678 20 | 0123456789012345678901234567890123456789012345678 21 | -------------------------------------------------------------------------------- /test/web/big.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | for each (i in 800) { 3 | write(" Line: %05d %s".format(i, "aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd
\r\n")) 4 | } 5 | %> 6 | -------------------------------------------------------------------------------- /test/web/big.esp: -------------------------------------------------------------------------------- 1 | <% 2 | { 3 | int i; 4 | for (i = 0; i < 800; i++) { 5 | espRender(conn, "Line: %05d %s", i, "aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccccddddddd
\r\n"); 6 | } 7 | } 8 | %> 9 | -------------------------------------------------------------------------------- /test/web/big.php: -------------------------------------------------------------------------------- 1 | \r\n"; 4 | } 5 | ?> 6 | -------------------------------------------------------------------------------- /test/web/caching/cache.ejs: -------------------------------------------------------------------------------- 1 | <% write("{ number: " + Date.ticks + "}"); %> 2 | -------------------------------------------------------------------------------- /test/web/caching/cache.esp: -------------------------------------------------------------------------------- 1 | <% 2 | setHeader("Content-Type", "text/plain"); 3 | render("{ number: %Ld, uri: '%s', query: '%s' }\r\n", mprGetTicks(), getUri(), getQuery()); 4 | %> 5 | -------------------------------------------------------------------------------- /test/web/caching/cache.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/web/caching/client.html: -------------------------------------------------------------------------------- 1 | client 2 | -------------------------------------------------------------------------------- /test/web/chinese.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <% 8 | session["message"] = "比较长的中文测试中60周年中秋快乐,月饼圆又圆……" 9 | redirect("/web/chinese2.ejs") 10 | %> 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/web/chinese2.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <% 8 | write(session["message"]) 9 | %> 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/web/compress/compressed.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/compress/compressed.txt.gz -------------------------------------------------------------------------------- /test/web/dir/index.html: -------------------------------------------------------------------------------- 1 | /dir/index.html 2 | Hello /dir/index.html 3 | 4 | -------------------------------------------------------------------------------- /test/web/directives.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Directives 4 | 5 | 6 | <%^start 7 | char *msg = "Hello World"; 8 | int x = 42; 9 | 10 | espSetParam(conn, "message", msg); 11 | espSetIntParam(conn, "number", x); 12 | -%> 13 |

ESP Directives

14 | Today's Message: @@message 15 | Lucky Number: @@number 16 | Hostname: <%= mprGetDomainName() %>.<%= %s mprGetHostName() %> 17 | Time: <%= mprGetDate(0) %> 18 | Formatted Number: <%= %,d 12345678 %> 19 | Safe Strings: <%= %S "" %> 20 | Safe Variables: @@exploit 21 | Weather: @@weather 22 | 23 | 24 | 25 | <%^end espSetStatus(conn, 200); %> 26 | -------------------------------------------------------------------------------- /test/web/dump.esp: -------------------------------------------------------------------------------- 1 | <% 2 | // This will emit a plain-text dump of the request details 3 | setContentType("text/plain"); 4 | showRequest(); 5 | -%> 6 | -------------------------------------------------------------------------------- /test/web/dump.php: -------------------------------------------------------------------------------- 1 | $value) { 4 | echo "_SERVER[$key] = \"$value\"\n"; 5 | } 6 | foreach ($_ENV as $key => $value) { 7 | echo "_ENV[$key] = \"$value\"\n"; 8 | } 9 | */ 10 | foreach ($_GET as $key => $value) { 11 | echo "_GET[$key] = \"$value\"\n"; 12 | } 13 | foreach ($_POST as $key => $value) { 14 | echo "_POST[$key] = \"$value\n\""; 15 | } 16 | foreach ($_REQUEST as $key => $value) { 17 | echo "_REQUEST[$key] = \"$value\n\""; 18 | } 19 | ?> 20 | -------------------------------------------------------------------------------- /test/web/ejsProgram.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | setHeader("Content-Type", "text/plain", true) 3 | if (request.params.code) { 4 | request.status = request.params.code 5 | } else if (request.params.redirect) { 6 | redirect(request.params.redirect) 7 | } 8 | request.show(request) 9 | %> 10 | -------------------------------------------------------------------------------- /test/web/empty.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/empty.html -------------------------------------------------------------------------------- /test/web/english/eng.html: -------------------------------------------------------------------------------- 1 | 2 | Hello English 3 | 4 | -------------------------------------------------------------------------------- /test/web/exit.esp: -------------------------------------------------------------------------------- 1 | <% 2 | /* 3 | WARNING: Do not include this script in your web site ever!!!! 4 | This is just for testing locally and should never be distributed. 5 | */ 6 | mprTerminate(1, 0); 7 | %> 8 | -------------------------------------------------------------------------------- /test/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/favicon.ico -------------------------------------------------------------------------------- /test/web/form.ejs: -------------------------------------------------------------------------------- 1 | 2 | Form Test 3 | 4 | <% 5 | request.show("PARAMS", request.params) 6 | request.show("REQUEST", request) 7 | /* 8 | // Async reading 9 | request.dontAutoFinalize() 10 | let total = 0 11 | request.on("readable", function (event, request) { 12 | let data = new ByteArray 13 | if (count = request.read(data)) { 14 | total += count 15 | } else { 16 | print("GOT EOF " + total + " bytes") 17 | request.showRequest() 18 | request.finalize() 19 | } 20 | }) 21 | */ 22 | /* 23 | Sync reading 24 | buf = new ByteArray 25 | while ((count = request.read(buf)) > 0) { 26 | print("GOT " + count) 27 | } 28 | print("FINAL " + count) 29 | request.showRequest() 30 | request.finalize() 31 | print("LEAVING") 32 | */ 33 | %> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/web/form.esp: -------------------------------------------------------------------------------- 1 | form.esp 2 | 3 |
4 | Name "> 5 | Address "> 6 | 7 |
8 | 9 |

Request Details

10 |
11 |         <% showRequest(); %>
12 |     
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/web/form.php: -------------------------------------------------------------------------------- 1 | form.php 2 | 3 |
 4 |          $value) {
 9 |                 echo "_SERVER $key is $value 
\n"; 10 | } 11 | foreach ($_POST as $key => $value) { 12 | echo "_POST $key is $value
\n"; 13 | } 14 | foreach ($_GET as $key => $value) { 15 | echo "_GET $key is $value
\n"; 16 | } 17 | ?>
18 |
19 | Name 20 | Address 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /test/web/icons/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/back.gif -------------------------------------------------------------------------------- /test/web/icons/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/blank.gif -------------------------------------------------------------------------------- /test/web/icons/compressed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/compressed.gif -------------------------------------------------------------------------------- /test/web/icons/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/folder.gif -------------------------------------------------------------------------------- /test/web/icons/parent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/parent.gif -------------------------------------------------------------------------------- /test/web/icons/space.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/space.gif -------------------------------------------------------------------------------- /test/web/icons/text.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/icons/text.gif -------------------------------------------------------------------------------- /test/web/include.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | write("Hello from included text") 3 | %> 4 | -------------------------------------------------------------------------------- /test/web/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | index.html 3 | <% write("Hello /index.ejs"); %> 4 | 5 | -------------------------------------------------------------------------------- /test/web/index.en.html: -------------------------------------------------------------------------------- 1 | 2 | English Suffix 3 | 4 | -------------------------------------------------------------------------------- /test/web/index.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Home Page 4 | 5 | 6 |

ESP Home Page

7 |

Greetings: <% render("Hello Home Page"); %>

8 | 9 | 10 | -------------------------------------------------------------------------------- /test/web/index.fr.html: -------------------------------------------------------------------------------- 1 | 2 | Bonjour tout le monde 3 | 4 | -------------------------------------------------------------------------------- /test/web/index.html: -------------------------------------------------------------------------------- 1 | index.html 2 | Hello /index.html 3 | 4 | -------------------------------------------------------------------------------- /test/web/index.php: -------------------------------------------------------------------------------- 1 | index.php 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/web/inner.esp: -------------------------------------------------------------------------------- 1 | <% render("Hello from inner text"); -%> 2 | -------------------------------------------------------------------------------- /test/web/lines.txt: -------------------------------------------------------------------------------- 1 | LINE 1 2 | LINE 2 3 | LINE 3 4 | -------------------------------------------------------------------------------- /test/web/listing/test.dat: -------------------------------------------------------------------------------- 1 | Test data: Thu Sep 17 20:17:22 PDT 2009 2 | -------------------------------------------------------------------------------- /test/web/listing/test_001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/listing/test_001.jpg -------------------------------------------------------------------------------- /test/web/listing/test_002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/listing/test_002.jpg -------------------------------------------------------------------------------- /test/web/listing/test_003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/listing/test_003.jpg -------------------------------------------------------------------------------- /test/web/main.html: -------------------------------------------------------------------------------- 1 | main.html 2 | MAIN SERVER 3 | 4 | -------------------------------------------------------------------------------- /test/web/nap.ejs: -------------------------------------------------------------------------------- 1 | 2 | Ejscript Page 3 | 4 | <% 5 | // This is used by ejs/* tests 6 | write("Napping 2 seconds .. " ) 7 | App.run(2 * 1000, true) 8 | write("Awake") 9 | %> 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/web/nap.esp: -------------------------------------------------------------------------------- 1 | 2 | ESP Nap Page 3 | 4 | <% 5 | render("Napping 15 seconds .. " ); 6 | flush(); 7 | mprSleep(15 * 1000); 8 | render("Awake"); 9 | %> 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/web/notFound.html: -------------------------------------------------------------------------------- 1 | Not Found 2 | Bad luck - Can't find that document 3 | 4 | -------------------------------------------------------------------------------- /test/web/nph-test.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "$SERVER_PROTOCOL 200 OK\r" 4 | echo "Content-type: text/html\r" 5 | echo "Connection: close\r" 6 | echo "Custom-Header: true\r" 7 | echo "\r" 8 | echo "

NPH-CGI program

\r" 9 | echo "\r" 10 | -------------------------------------------------------------------------------- /test/web/numbers.html: -------------------------------------------------------------------------------- 1 | 0123456789012345678901234567890123456789012345678 2 | 0123456789012345678901234567890123456789012345678 3 | 0123456789012345678901234567890123456789012345678 4 | 0123456789012345678901234567890123456789012345678 5 | 0123456789012345678901234567890123456789012345678 6 | 0123456789012345678901234567890123456789012345678 7 | 0123456789012345678901234567890123456789012345678 8 | 0123456789012345678901234567890123456789012345678 9 | 0123456789012345678901234567890123456789012345678 10 | 0123456789012345678901234567890123456789012345678 11 | 0123456789012345678901234567890123456789012345678 12 | 0123456789012345678901234567890123456789012345678 13 | 0123456789012345678901234567890123456789012345678 14 | -------------------------------------------------------------------------------- /test/web/numbers.txt: -------------------------------------------------------------------------------- 1 | 01234567890123456789012345678901234567890123456789END 2 | -------------------------------------------------------------------------------- /test/web/outer.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ejscript Test Program 4 | 5 | 6 | <%@ include "web/include.ejs" %> 7 |

Ejscript Test Program

8 |

Server Time: <%= Date() %>

9 | 10 | 11 | -------------------------------------------------------------------------------- /test/web/outer.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Test Program 4 | 5 | 6 | <%@ include "inner.esp" %> 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/web/redirect.esp: -------------------------------------------------------------------------------- 1 | 2 | <% redirect("/index.esp"); %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/web/redirect.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/web/session.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | // Write the old session value and then set to 77. 3 | // This is used by ejs/session.tst 4 | write(session["value"]) 5 | session["value"] = 77 6 | %> 7 | -------------------------------------------------------------------------------- /test/web/session.esp: -------------------------------------------------------------------------------- 1 | <% 2 | render(getSessionVar("value")); 3 | setSessionVar("value", "77"); 4 | %> 5 | -------------------------------------------------------------------------------- /test/web/simple.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/web/sleep.ejs: -------------------------------------------------------------------------------- 1 | <% App.sleep(300000) %> 2 | -------------------------------------------------------------------------------- /test/web/sleep.esp: -------------------------------------------------------------------------------- 1 | <% mprSleep(20000); %> 2 | -------------------------------------------------------------------------------- /test/web/sleep.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/web/slow.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Content-type: text/html" 4 | echo "" 5 | echo "PATH $PATH" 6 | echo "

Simple CGI program

" 7 | echo "
" 
 8 | 
 9 | i=0
10 | while [ $i -lt 20 ] ;  do
11 |     sleep 3
12 |     date
13 |     i=`expr $i + 1`
14 | done
15 | echo "
" 16 | echo "" 17 | -------------------------------------------------------------------------------- /test/web/spin.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/web/sub/a.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/sub/a.html -------------------------------------------------------------------------------- /test/web/sub/b.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/sub/b.html -------------------------------------------------------------------------------- /test/web/sub/sub1/c.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ni-webtech/appweb-4/37f3f7391e848c2f786ae84ff600b415d93e1445/test/web/sub/sub1/c.html -------------------------------------------------------------------------------- /test/web/test.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Content-type: text/html" 4 | echo "" 5 | echo "PATH $PATH" 6 | echo "

Simple CGI program

" 7 | echo "
" 
 8 | env
 9 | echo "
" 10 | echo "" 11 | -------------------------------------------------------------------------------- /test/web/test.dat: -------------------------------------------------------------------------------- 1 | Test data: Thu Sep 17 20:17:22 PDT 2009 2 | -------------------------------------------------------------------------------- /test/web/test.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ejscript Test Program 4 | 5 | 6 |

Ejscript Test Program

7 |

Server Time: <%= Date() %>

8 |

Started <%= "%5.1f seconds ago".format(App.started.elapsed / 1000) %>.

9 | 10 | 11 | -------------------------------------------------------------------------------- /test/web/test.es: -------------------------------------------------------------------------------- 1 | print("TOP") 2 | exports.app = function (request) { 3 | return { 4 | status: 201, 5 | headers: {"Content-Type": "text/html"}, 6 | body: "Hello Cruel World\n" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/web/test.esp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Test Program 4 | 5 | 6 |

ESP Test Program

7 |

Server Time: <%= mprGetDate(0) %>

8 |

Product Name: <%= mprGetAppName() %>

9 |

Since Boot: <% 10 | { 11 | MprTime elapsed = (mprGetTime() - conn->http->booted) / 1000; 12 | render("%02d:%02d:%02d", elapsed / 3600, (elapsed / 60) % 60, elapsed % 60); 13 | } 14 | %>

15 | 16 | 17 | -------------------------------------------------------------------------------- /test/web/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple 4 | 5 | 6 | 7 | Hello world 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/web/test.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/web/test.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | print "Content-type: text/html\n"; 4 | print "\n"; 5 | print "\n"; 6 | print "\n"; 7 | print "\n"; 8 | print "

Hello World from Perl

\n"; 9 | print "\n"; 10 | print "\n"; 11 | 12 | 0; 13 | -------------------------------------------------------------------------------- /test/web/test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | print "Content-type: text/html\n\n" 4 | print "Hello world from Python Land!" 5 | -------------------------------------------------------------------------------- /test/web/test.xesp: -------------------------------------------------------------------------------- 1 | <% 2 | setHeader("Content-Type", "text/plain"); 3 | render("{ number: %Ld, uri: '%s', query: '%s' }\r\n", mprGetTicks(), getUri(), getQuery()); 4 | %> 5 | -------------------------------------------------------------------------------- /test/web/test.xml: -------------------------------------------------------------------------------- 1 | 2 | Joe Green 3 |
410 Main 4 | YorkVT 5 |
6 |
7 | 8 | 2.50 9 | 30 10 | 11 |
12 | -------------------------------------------------------------------------------- /test/web/upload.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | <% 4 | if (request.method == "POST") { 5 | // request.show("PARAMS", request.params) 6 | // request.show("request.files", request.files) 7 | 8 | request.show("PARAMS", request.params) 9 | request.show("request.files", request.files) 10 | for each (f in request.files) { 11 | // print("MV " + f.filename + " to " + "web/tmp/" + f.clientFilename) 12 | Path(f.filename).rename("web/tmp/" + f.clientFilename) 13 | } 14 | write("Uploaded") 15 | } 16 | %> 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/web/upload/upload-cgi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Upload 4 | 5 | 6 |

File Upload to CGI

7 |
8 | 9 | 10 | 11 | 12 | 13 |
Name
Address
Photo:
14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/web/upload/upload-esp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Upload 4 | 5 | 6 |

File Upload to EGI

7 |
8 | 9 | 10 | 11 | 12 | 13 |
Name
Address
Photo:
14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/web/upload/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Upload 4 | 5 | 6 |

File Upload to HTML

7 |
8 | 9 | 10 | 11 | 12 | 13 |
Name
Address
Photo:
14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/web/upload/upload.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

File Upload to PHP using the Appweb Upload Filter

7 | 8 | "; 12 | print_r($_FILES); 13 | print_r($_POST); 14 | print_r($HTTP_POST_VARS); 15 | echo ""; 16 | */ 17 | 18 | /* 19 | $uploaddir = '/tmp/'; 20 | $uploadfile = '/tmp/' . basename($_FILES['userfile']['name']); 21 | 22 | if (isset($_POST['MAX_FILE_SIZE'])) { 23 | foreach ($_FILES as $key => $value) { 24 | echo "FILES $key is $value
\n"; 25 | } 26 | 27 | echo "

Upload temp file " . $_FILES['userfile']['tmp_name'] . "

"; 28 | 29 | if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { 30 | echo "

File saved as " . $uploadfile . "

"; 31 | } else { 32 | echo "Could not move uploaded file\n"; 33 | } 34 | } 35 | */ 36 | ?> 37 | 38 |
39 | 40 | 41 | 42 |
File
43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /test/web/upload/uploadComplete.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Upload Complete

4 | 5 | 6 | -------------------------------------------------------------------------------- /test/web/vhost/iphost/private.html: -------------------------------------------------------------------------------- 1 | 2 | PRIVATE 3 | Private 4 | 5 | -------------------------------------------------------------------------------- /test/web/vhost/namehost1/vhost1.html: -------------------------------------------------------------------------------- 1 | 2 | Local1 ALL ACCESS 3 | Welcome to Local1 4 | 5 | -------------------------------------------------------------------------------- /test/web/vhost/namehost2/vhost2.html: -------------------------------------------------------------------------------- 1 | 2 | ALL ACCESS 3 | Welcome to Local2 4 | 5 | --------------------------------------------------------------------------------