Here are a few examples of simple or dummy servers written using nanoserv, all of them can be run from the command line.

Click on the filename to view the highlighted source code.


get_http_head.php

HTTP/1.0 200 OK Content-Type: text/html; charset=ISO-8859-1 Content-Security-Policy-Report-Only: object-src 'none';base-uri 'self';script-src 'nonce-cxWazuTc9cCriiNAPRTM4A' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp Date: Thu, 17 Sep 2026 13:40:13 GMT Server: gws X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Expires: Thu, 17 Sep 2026 13:40:13 GMT Cache-Control: private Set-Cookie: AEC=Aaa9EJrwsqd-i6pd6kuIX276jV8BcNOuV6GE_kS5-wFr1aPVnuEqCrgyouI; expires=Tue, 16-Mar-2027 13:40:13 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax