https://github.com/mr-vaibh/http-server
Manually created server in Python
https://github.com/mr-vaibh/http-server
python server socket
Last synced: about 1 year ago
JSON representation
Manually created server in Python
- Host: GitHub
- URL: https://github.com/mr-vaibh/http-server
- Owner: mr-vaibh
- Created: 2022-01-15T20:14:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-15T20:15:24.000Z (over 4 years ago)
- Last Synced: 2025-02-16T11:16:15.521Z (over 1 year ago)
- Topics: python, server, socket
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTP Server
This server is made in python using TCP [socket](https://docs.python.org/3/library/socket.html) module. Meant as a learning exercise.
- Supports HEAD and GET requests.
- Uses multithreading to serve more than one client at a time using the [thread](https://docs.python.org/3/library/thread.html) module.
- Looks up for index.html by default if file not specified.
- Gives 200,400 and 404 responses.
- Set to listen to requests on port 8888 on localhost.
### Set Up :
- Clone the repository.
- Add files you wish to serve to this repository as this is the base directory.
- Change the port to something else if any other service is using the port 8888.
- Run `./server.py`.
- Go to the address `localhost:8888/relative/path/of/file` using any browser.