Here goes the http and gopher additions to the 1.11x4 version along with some improvements in the ftp server, etc. Enjoy! Thanks to Phil Karn (KA9Q) for this wonderful creation.
Note: Some of these commands have become a part of the standard JNOS in the mean time.
gopher maxcli [n],
gopher tdisc [secs], and
gopher simult [n] sysop commands.
Almost completely rewritten it again. I took a lot of code and ideas from Brian Lantz' adaptation of the http server to TNOS. An unfortunate effect of this is backwards incompatibility. So, be careful and read this document thoroughly.
Multiple http servers each listening on a different port number, and using a different root path can be run. The maximum number of servers is compile time configurable and is 5 by default. This document will explain the setup of only one. But, it applies to each instance of the server.
start http [port#] [d] [rootdir]
If you omit the bracketed options, the defaults are [port#] == 80; [d] == 'C'; [rootdir] == '/gopher'.
The drive designation in the URL can be dropped, in which case, the drive you have set in the start command will be used. And dir1 is a sub directory of the [rootdir]
into the access file created above.
at the DOS prompt. Be careful to exactly copy the output to the access file.
where tag depends on cmdname, and value depends on tag. Here is a list of commands and their associated tags:
This version of the HTTP server has a sort of cgi support. Actually, it is just an interface for further extension of the server code. I thought a lot about how we can support some form and query processing in this server. Any general form processing function I could think of would be too limited. Some kind of scripting language seemed as a possibility, but anything useful and flexible enough would require a lot of memory and would exceed my programming abilities. So, at last, I decided to define a uniform interface and provide a hook for the extension of the server source code. That means, if you know C and the basics of the Jnos code, and a little of the HTTP 1.0 specification, you can write functions for form processing and hook it up with the server source code easily. And since the interface is uniform, these functions can be exchanged between people.
What you have to do is just write a C function which has a certain prototype, and register it in the Cgis[] array in http.c, and that function will be called with all the necessary information passed to it. Then you just have to process the info whichever way you want, and produce an output for the client.
I won't talk about the programming details of this here. I tried to explain how it works in the http.c to which you will append your functions. I also included two such functions to demonstrate the way they work: One is a simple x-bitmap graphic hit counter which I have been using for quite a while to supply hit counting service to my friends who have their pages on a server which doesn't allow SSI. The other is a simple form entry logging function which is solely for demonstration purposes. Neither of them are compiled in by default. If you want to see their functioning, you have to turn two '#undef's in http.c to '#define's.