A simple API for a school project called "Zia", HTTP Server in C++.
C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
IConfiguration.hpp
IModule.hpp
IRequest.hpp
README
dll.hpp
httpdef.hpp
meow.sh
network.hpp
nyan-cat.mp3

README

     o  +           +        +    
 o          +                    o
     o                 +          
 +      o     +              o    
  o     +        o               +
 _-_-_-_-_-_-_-,------,  o      + 
 -_-_-_-_-_-_-_|   /\_/\    +     
 _-_-_-_-_-_-_~|__( ◕ .◕)  meow~  
 -_-_-_-_-_-_-_  ""  ""       
 +      +     o        o      +   
 o        +                o     +
 +      o         +     +       o 
     +         +                  
        +           o        +    

  ~ Meow ~

The simplest API ever for your implementation of the HTTP Server Zia.
Vote for us, and you will not have to change anything in your server code.
It's so generic, so simple, so concise... that I turned into a cat. Meow~

                         ~ Official WebSite : http://meow.paysdu42.fr/ ~



  ~ ~ ~ Example of Server ~ ~ ~

This pretty short pseudo-code explains where the modules can interact
with the server classic process to receive, treat and answer request.
As you can see, it can interact in every step during the process
and it's so simple, generic and concise that you can do everything
you want with just a few steps.

Zia {
  Initialisation/configuration/...
  IModule->onModuleLoad
  While (accept connections ; IModule->onClientConnection) {
    IModule->beforeReadHeader
    read header and fill IRequest
    IModule->afterReadHeader
    IModule->beforeReadContent
    read content (using the info size in the header) and fill IRequest
    IModule->afterReadContent
    if (!IModule->letMeDoThisMethod) {
        IModule->execBeforeMethod
	do the default behavior
	IModule->execAfterMethod
     }
    if (!(answer = IModule->letMeDoTheAnswer)) {
        answer = forge default answer
        answer = IModule->modifyAnswer(answer)
     }
    send answer
   }
  disconnection && IModule->disconnect
  }
}

  ~ ~ ~ Example of Module ~ ~ ~

This pseudo-code show an example of some modules.

 ~ Compression ~

IModule {
  IModule->onModuleLoad {
    init gzip
    true
  }
  IModule->onClientConnection {}
  IModule->beforeReadHeader {}
  IModule->afterReadHeader {}
  IModule->beforeReadContent {}
  IModule->afterReadContent {
    if (IRequest->getHeaderContent('Content-Encoding') == 'gzip')
      unzip content
  }
  IModule->letMeDoThisMethod { return false }
  IModule->execBeforeMethod {}
  IModule->execAfterMethod {}
  IModule->letMeDoTheAnswer { return NULL }
  IModule->modifyAnswer {
    if (IRequest->getHeaderContent('Content-Encoding') == 'gzip')
      zip content    
  }
  IModule->onClientDisconnection {}
}