Skip to content

SImplest mutithreaded webserver to serve request from BROWSER or REST Clients.

Notifications You must be signed in to change notification settings

chowmean/http_webserver_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

#Simple HTTP webserver ##This is made using SOCKETSERVER

###How to use:

####For Linux

  • Initial Installation

chmod a+x server.sh

./server.sh install

./server.sh run PORT_NO HOST

For windows

  • Install redis server

sudo apt-get install redis-server

  • Run redis server

redis-server

  • Run the file with HOST and PORT input from command line

python asynchttpserver.py 8080 0.0.0.0

###Endpoints

  • Get /api/request?connId=12&timeout=120
  • Get /serverStatus
  • Post /api/kill {'connId':Int}

###Features

  • Multithreading
  • Handling all type of requests.
  • Error Handling
  • Adding function to kill the request in between.
  • URL handling and mapping
  • Implementing cache using redis

###Debuging options

  • Try cleaning your redis server everytime you restart the server. If any stray data is present it will cause deviations.

  • Run these commands to do so in python shell

import redis

r = redis.StrictRedis(host='localhost', port=6379, db=0)

key in r.scan_iter():

...print key, r.delete(key)

author : chowmean

About

SImplest mutithreaded webserver to serve request from BROWSER or REST Clients.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published