about
download
how-to
 

Frequently Asked Questions

1. If jaminid does not serve files, or have scripts, how can you serve active content through it?

jaminid works through demultiplexors of HTTP requests called ContentOracles - that extend the ContentOracle class. Content oracles by contract do one things: they produce the content as a regular java String.

2. How do I set up a Daemon and a ContentOracle for my Application?

Usually you will need to extend the ContentOracle class and override the demultiplex(..) function. A good, quick example is in the com.prolixtech.jaminid-example.HelloWorldServer class.

Here's a recap: Make a new class that will serve as your ContentOracle

	  public class HelloWorldServer extends ContentOracle {
		  // other functions you may use
		  public String demultiplex(Request connRequest, Response connResponse) {
		  	// here you can use the request object to view information about the request,
			// and optionally the reply object to inform the server of the response
			// (error codes, cookies, and more)
			
			return theWebPageInHTML; // a String you have assembled in the function
		  }
	  }
	  

Now, in your main class, start a Daemon using the ContentOracle you made:

		HelloWorldServer s = new HelloWorldServer();
      	Daemon myDaemon = new Daemon(PORT, s);
		// where PORT is the HTTP port (usually HTTP holds port 80)
	  

Note that Daemon runs as a thread, so your application will continue to run even after it finishes. Usually, daemons by definition keep running; if you need to close the daemon for some reason, call the tearDown() function.

3. Is this Daemon HTTP1.1 compliant?

Yes.

4. Are there any security issues with using this Daemon?

No. Remember, on its own, the daemon does not serve any files, nor even accesses the filesystem at all apart from configuration files. That is where the largest errors have been in other major web servers.

If a user needs to implement a file server running on this daemon, they must be careful to follow a few good ideas:

  • Try not to run as root on operating systems that have users and groups.
  • Make sure the Canonical filenames fall within the root paths allowed by your application - i.e. no symlinks are followed, and the "../.." trick is not used.
  • Whenever possible, just use a single directory for files and put everything in it. If for some reason you need to have such a large number of files that this becomes impractical, perhaps you should look into a traditional HTTP server.

5. Is HTTP authentication implemented?

No, it will be implemented very shortly however. It is very simple to do non-http authentication, and if you have a user authentication system already in place, it is very easy to use that instead.

6. Does jaminid support secure-HTTP?

No. There are plans to implement it in the future.

7. Who wrote this project?

Constantinos Michael wrote the initial project and is currently the project leader.

8. Why was this project written?

Because surprisingly, there was nothing out there that could perform these simple functions. You'll find Perl code to do what this project does, and you could actually also perform a system reminescent of the ContentOracle by using custom apache plugins.

This project was in essence written as part of a larger project - Project MuseBox, however it is good enough to release on its own.

9. What are some examples I can use jaminid for?

  • search engines
  • file sharing programs
  • internet jukebox players
  • remote administration tools
  • web servers
  • email / newsreaders
  • lightweight Web Services - infact, interprocess communication
  • database accessors

10. What does jaminid mean?

JAva MINI Daemon.

 

SourceForge.net Logo Download jaminid on SourceForge.net

The project leader is Constantinos Michael.

This project is open source, released under the LGPL. If you need to use this project and would like to obtain it under a different license, please contact the administrators to ask for it.