Giter Site home page Giter Site logo

basic-web-server's Introduction

Basic Java Web Server

This project is a Java based multithreaded TCP web server that implements responses for HTTP 200, 301, and 404 codes. It was made using Java 8 and runs by default on port 6789 of localhost.

This project is licensed under the terms of the MIT license.

Usage

  • Compiling the Program

    • Open console and type javac src/WebServer.java
  • Running the Program

    • Type java src/WebServer to run the program
  • Testing HTTP 200 OK:

    • In your browser of choice type localhost:6789/index.html into the address bar. A webpage should appeart with the text "Hello, World! This is a simple HTML document." and an image of a cityscape underneath.
  • Testing HTTP 404 Not Found:

    • In your browser of choice type localhost:6789/whatever into the address bar. An error page should load that says "404 Error: Page Not Found" in big bold letters.
  • Testing HTTP 301 Moved Permanently (Redirect):

    • In your browser of choice type localhost:6789/index, localhost:6789/, localhost:6789, or localhost:6789/index.htm into the address bar. Typing any of the above will redirect you to the index.html page with the Hello message and image.

basic-web-server's People

Contributors

mwharrisjr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.