Author:
- Name: Anthony C. Howe
Location: CA - Canada
To build:
make
There is an alternate version that is unobfuscated, provided by the author in 2024. See Alternate code below.
Bugs and (Mis)features:
The current status of this entry is:
STATUS: INABIAF - please DO NOT fix
For more detailed information see 2004/hibachi in bugs.html.
To use:
cd build; ./hibachi-start.sh &
Then use your web browser to visit http://localhost:8008/
. When you’re
finished make sure to kill hibachi
.
NOTE: you must be in the build
directory when running hibachi-start.sh
for
this to work right.
Alternate code:
This version, contained in src-alt/
, is an unobfuscated version provided by
the author in 2024.
Alternate build:
make alt
This will run the configure
script and then compile and link in (in
build-alt/
) the binary hibachi
.
Alternate use:
cd build-alt ; ./hibachi-start.sh &
Then with your browser do the same as for the original source.
Judges’ remarks:
This entry violates the guidelines in so many ways! We are not exactly sure how many organisations will be upset with this entry, but we are considering starting an IOCCC standards body just to reign in the likes of Mr Howe.
This entry also has the dubious honour of being the only one to have been
submitted with its own configure
script.
NOTE: the author states there is a tarball hibachi.tgz
but this was extracted
so the file does not exist here.
Author’s remarks:
README.TXT (Feb 2004)
Hibachi
is a simple, small, and (probably) very secure web server.
There is a hibachi.tgz
file (NOTE: this file was removed by the judges after
extraction) that unpacks several support files and a subdirectory tree
containing the documentation and examples. It can be viewed by:
tar -zxf hibachi.tgz
lynx hibachi/localhost/index.html
Or once Hibachi
is running, use a web browser (preferably one that
supports images and JavaScript, to view the documentation and try
some of the CGI examples) to visit: http://localhost:8008/
.
Building
To build just the executable:
For Cygwin, FreeBSD, Linux (newer), Mac OS X:
gcc -o hibachi hibachi.c
For Linux (older):
gcc -DSHUT_WR=1 -o hibachi hibachi.c
For SunOS:
gcc -o hibachi hibachi.c -lnsl -lsocket
Since some systems place socket and network functions into other libraries, a
GNU autoconf
configure script has been
provided to figure out the necessary link libraries, to verify all the necessary
headers and functions are present, and setup the #!
paths for the CGI
examples. In which case the preferred build commands are:
./configure [--enable-port=number]
make
To start the server on the default port (8008):
cd build;
./hibachi-start.sh &
To test the server:
lynx http://localhost:8008/
To stop the server:
kill %1
Features
Supports virtual hosts.
Supports all MIME types.
Supports CGI: Common Gateway Interface scripts and programs.
Supports multiple
index.*
file extensions and types:index.htm, index.html, index.php, index.pl, index.sh, index.rb, index.py
Supports subset of RFC 2616 HTTP/1.1 methods:
GET
,HEAD
, andPOST
.Simple & straight forward configuration using environment variables.
Portability across Unix-like environments, such as: Cygwin, FreeBSD, Linux, SunOS.
Known to work with Lynx, Mozilla, Opera, and Internet Explorer web browsers.
Is a dedicated process-forking server that does not use inetd.
Is secure against relative path file snooping.
Is secure against directory searches.
CGI script execution managed through Unix file permissions.
~155 lines of source, 1940 bytes long by IOCCC 2004 rules, ~6KB compiled & stripped for FreeBSD.
Superior & smaller than micro_httpd from http://www.acme.com/.
And has a really cool tongue-in-cheek animated logo too.
Comments
This code is properly indented using the One True Brace style.
HTTP/1.0 200 OK
==HTTP/1.1 200 OK CRLF Connection: close
?getenv()
==putenv()
?Hibachi
can serve www.ioccc.org.Commented obfuscation change log information available.
Known Issue
- The links (text) web browser does not support RFC 2616 section 7.2.1
paragraph 3 sentence 2, and so fails to display responses from
hibachi
.
Suggested IOCCC Categories
- Best Utility
- Best Support
- Most Portable Package
- Most Likely to Cook Apache
- Best Interpretation of RFC 2616
- Winner of The Far Too Much Free Time Award
Changelog
For a list of significant changes made during development, see src/localhost/CHANGELOG.TXT.
Inventory for 2004/hibachi
Primary files
- hibachi.alt.c - author provided unobfuscated code
- hibachi.c - entry source code
- Makefile - entry Makefile
- hibachi.orig.c - original source code
- src-alt/configure - GNU Autoconf script for alt server
- src-alt/localhost/index.html - home page of alt hibachi alt web server
- src/configure - GNU Autoconf script
- src/localhost/index.html - home page of alt hibachi web server
- src-alt/IOCCC-2004/mkentry.c - IOCCC tool of 2004 to package entries
- src-alt/ioccc.c - IOCCC size tool
- src-alt/localhost/reference/rfc2616.html - RFC 2616 - Hypertext Transfer Protocol - alt server
- src-alt/localhost/test/perl/index.html - perl test page of alt hibachi server
- src-alt/localhost/test/php/index.php - PHP making an ISO 8601:2000 calendar for alt server
- src-alt/localhost/test/ruby/index.rb - ruby home page for alt server
- src-alt/localhost/test/shell/test0.sh - POSIX shell CGI home page for alt server
- src/localhost/CHANGES-OBFUSCATED.TXT - obfuscated changelog for hibachi
- src/localhost/reference/rfc2616.html - RFC 2616 - Hypertext Transfer Protocol
- src/localhost/test/perl/index.html - perl test page of hibachi server
- src/localhost/test/php/index.php - PHP making an ISO 8601:2000 calendar
- src/localhost/test/ruby/index.rb - ruby home page
- src/localhost/test/shell/test0.sh - POSIX shell CGI home page
- src-alt/transform.sed - sed(1) script for building unobfuscated code
- src-alt/hibachi-start.sh - start the alt web server
- src-alt/localhost/test/perl/yahoo-ticker.pl - stock price fetch example in Perl for alt server
- src/hibachi-start.sh - start the web server
- src/localhost/test/perl/yahoo-ticker.pl - stock price fetch example in Perl
- src-alt/configure.in - GNU Autoconf script for alt server
- src-alt/hibachi-start.sh.in - hibachi-start.sh declarations for alt server
- src-alt/localhost/CHANGELOG.TXT - changelog for hibachi alt code
- src/configure.in - GNU Autoconf script
- src/hibachi-start.sh.in - hibachi-start.sh declarations
- src/localhost/CHANGELOG.TXT - changelog for hibachi
Secondary files
- 2004_hibachi.tar.bz2 - download entry tarball
- README.md - markdown source for this web page
- .entry.json - entry summary and manifest in JSON
- .gitignore - list of files that should not be committed under git
- .path - directory path from top level directory
- src-alt/localhost/Img/cygwin-icon.gif - image for home page for alt server
- src-alt/localhost/Img/freebsd.gif - image for home page for alt server
- src-alt/localhost/Img/hibachi-256-oc-nc-300x150.gif - image for home page for alt server
- src-alt/localhost/Img/hot-coal-edge-110-indent.png - image for home page for alt server
- src-alt/localhost/Img/logosml.256.png - image for home page for alt server
- src-alt/localhost/Img/php-small-trans-light.gif - image for home page for alt server
- src-alt/localhost/Img/powered-by-hibachi-150x75.png - image for home page for alt server
- src-alt/localhost/Img/rectangle_power_perl.gif - image for home page for alt server
- src-alt/localhost/Img/sun_logo.gif - image for home page for alt server
- src-alt/localhost/Img/win.gif - image for home page for alt server
- src-alt/localhost/style.css - CSS for home page for alt server
- src-alt/localhost/test/perl/yahoo-ticker.pl.in - stock price fetch declarations for alt server
- src-alt/localhost/test/php/Date.php - PHP example page support file for alt server
- src-alt/localhost/test/php/index_php.in - PHP example page support file for alt server
- src-alt/localhost/test/php/info.php - PHP example support file for alt server
- src-alt/localhost/test/php/info.php.in - PHP example page support file for alt server
- src-alt/localhost/test/php/sendform.html - php example page support file for alt server
- src-alt/localhost/test/php/sendform.php - PHP example page support file for alt server
- src-alt/localhost/test/php/sendform.php.in - PHP example page support file for alt server
- src-alt/localhost/test/ruby/LUHN.rb - ruby example page support file for alt server
- src-alt/localhost/test/ruby/index_rb.in - ruby example page support file for alt server
- src-alt/localhost/test/shell/dump.sh - POSIX shell script support file for alt server
- src-alt/localhost/test/shell/test1.sh - POSIX shell script support file for alt server
- src-alt/localhost/test/shell/test2.sh - POSIX shell script support file for alt server
- src-alt/makefile.in - makefile template for alt server
- src/localhost/Img/cygwin-icon.gif - image for home page
- src/localhost/Img/freebsd.gif - image for home page
- src/localhost/Img/hibachi-256-oc-nc-300x150.gif - image for home page
- src/localhost/Img/hot-coal-edge-110-indent.png - image for home page
- src/localhost/Img/logosml.256.png - image for home page
- src/localhost/Img/php-small-trans-light.gif - image for home page
- src/localhost/Img/powered-by-hibachi-150x75.png - image for home page
- src/localhost/Img/rectangle_power_perl.gif - image for home page
- src/localhost/Img/sun_logo.gif - image for home page
- src/localhost/Img/win.gif - image for home page
- src/localhost/style.css - CSS for home page
- src/localhost/test/perl/yahoo-ticker.pl.in - stock price fetch declarations
- src/localhost/test/php/Date.php - PHP example page support file
- src/localhost/test/php/index_php.in - PHP example page support file
- src/localhost/test/php/info.php - PHP example support file
- src/localhost/test/php/info.php.in - PHP example page support file
- src/localhost/test/php/sendform.html - php example page support file
- src/localhost/test/php/sendform.php - PHP example page support file
- src/localhost/test/php/sendform.php.in - PHP example page support file
- src/localhost/test/ruby/LUHN.rb - ruby example page support file
- src/localhost/test/ruby/index_rb.in - ruby example page support file
- src/localhost/test/shell/dump.sh - POSIX shell script support file
- src/localhost/test/shell/test1.sh - POSIX shell script support file
- src/localhost/test/shell/test2.sh - POSIX shell script support file
- src/makefile.in - makefile template
- index.html - this web page