This is a simple project simulation of a real Web Server, Where it is possible to do multiple web request to a local server.
The main objective is to simulate, more efficiently, the functionality of a web server.
The libraries that i use are the following one's:
import socket
import request
import Thread
To debug/run the web server, follow the steps:
python3 webserver.py
The output will be like this:
Port 3000: trying to connect.
Port 3000: already connected.
The server is under state active.
Examples: - http://localhost:3000/Facebook.html - http://localhost:3000/Google.html - http://localhost:3000/ArqRedes.html
To connect the server as a client, you have to run the client script:
python3 client.py
the output will be a terminal where is possible to execute two commands.
- To display the response code use:
TCP/Server -> localhost 3000 -h ArqRedes.html
- To display the contents of the html file:
TCP/Server -> localhost 3000 -t ArqRedes.html