Java code for simple browser and server