Giter Site home page Giter Site logo

http-server's Introduction

HTTP Server

This server is based on WinApi (WinSocket), it supports HTTP 1.0

Plans

  • CGI parameters (/cgi/index.py ?key=abc%20text=lalala)
  • Improve CGI
  • Mime explicit indication from CGI scripts/programs
  • More return codes
  • POST method
  • Linux version

Short manual

All parameters must have length less than 1024 symbols
If a parameter is file or dir it must exists.

|--------------------|--------------------------------------|------------------|    
|        ITEM        |              WHAT IS IT              |    SUPPORTING    |
|--------------------|--------------------------------------|------------------|
| root               | root directory of site               |        YES       |
| index              | start page of site                   |        YES       |
| server_ip          | IP-address of server                 |        YES       |
| listen_port        | working port of site                 |        YES       |
| log                | directory with logs                  |        YES       |
| server_name        | name of site                         |    DECORATION    |
| heap_mb            | size of server`s heap (in megabytes) |        YES       |
| sendfilelist       | if 'on' server sends list of files   |        YES       |
|                    |  if a request file hasn`t extension  |                  |
| security           | if 'on' all requests that includes   |        YES       |
|                    | '..' ignores                         |                  |
| cgi                | cgi on/off (.pl, .py .exe)           |        YES       |
| cgipath            | cgi-bin                              |        YES       |
|--------------------|--------------------------------------|------------------|

C code of the configuration:

struct __server_configuration_struct {
    char ip[16];       /* server_ip    */
    char port[6];      /* listen_port  */
    char *name;        /* server_name  */
    char *index;       /* index        */
    char *log;         /* log          */
    char *root;        /* root         */
    int  heap_sz_mb;   /* heap_mb      */
    bool security;     /* security     */
    bool filelist;     /* sendfilelist */
    bool cgi;          /* cgi          */
    char *path;        /* cgipath      */
};

CGI

server directory
   |____  html  (root)
   |____  cgi   (path)
   |____  serv.exe
   |____  cgi.exe
   |____  config.conf
 
 All scripts must be in cgi dir, all queries are like 'href="/cgi/index.py"'

http-server's People

Contributors

gitproger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.