import time
from http.server import BaseHTTPRequestHandler, HTTPServer

from http_handler import HTTPHandler

HOST_NAME = '192.168.1.101'
#HOST_NAME = 'localhost'
PORT_NUMBER = 7172

if __name__ == '__main__':
    server_class = HTTPServer
    httpd = server_class((HOST_NAME, PORT_NUMBER), HTTPHandler)
    print(time.asctime(), 'Server Starts - %s:%s' % (HOST_NAME, PORT_NUMBER))
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        pass
    httpd.server_close()
    print(time.asctime(), 'Server Stops - %s:%s' % (HOST_NAME, PORT_NUMBER))