How to unlock Microsoft's Cassini Web Server

How to unlock Microsoft's Cassini Web Server


Summary

Cassini is a fairly full featured web server written in dotNet from Microsoft that runs on Microsoft Windows (of course). It includes support for ASP dotNet and will run on XP Home.

In an effort to try to prevent Cassini from cannibalizing the market for IIS, Microsoft decided to make it only serve requests from the local machine (i.e. only the machine running Cassini could browse the pages). This tip explains how to make Cassini serve pages to the outside world.

This note applies to Cassini v1.0.40305.0 from February 2004


Detail

  1. Open request.cs.
  2. Search for "IsLocal".
  3. You should find a couple of lines that look like:
    			// Limit to local requests only
    			if (!_conn.IsLocal) {
    				_conn.WriteErrorAndClose(403);
    				return;
    			}
    		
  4. Comment out the if. It should look like:
    			// Limit to local requests only
    			//if (!_conn.IsLocal) {
    			//    _conn.WriteErrorAndClose(403);
    			//    return;
    			//}
    		
  5. Depending on how you installed it, you may need to uncheck the read-only file attribute to save it.
  6. Recompile following the normal instructions (run build.bat)