This project demonstrates the implementation of a simple socket server and client in Python from scratch, without using any pre-built modules like socket
. The main purpose of this project is to learn and understand how sockets work and how to parse HTTP requests at a basic level.
Note: This implementation is for educational purposes only and should not be used in a production environment.
The motivation behind this project is to have fun while learning about the fundamentals of network programming, specifically sockets and HTTP protocol. This exercise helps in understanding the underlying mechanics of network communication which is often abstracted away by high-level libraries and frameworks.
- Navigate to the project directory.
- Run the server script:
python server.py
The server will start and listen for incoming connections.
- Open another terminal window.
- Navigate to the project directory.
- Run the client script with a name argument:
python client.py name
The client will send the name to the server, and the server will respond with a greeting.