Class jls.net.http.HttpServer

A HTTP server.
Defined in: HttpServer.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a HTTP server.
Field Summary
Field Attributes Field Name and Description
<static>  
jls.net.http.HttpServer.defaultContentTypes
Default content type objects.
Method Summary
Method Attributes Method Name and Description
<static>  
jls.net.http.HttpServer.bodyHandler(httpExchange)
A basic body handler implementation.
<static>  
jls.net.http.HttpServer.create(addr, backlog)
Creates a HTTP server for a specified socket address.
 
createContext(path, handler)
Creates a context at the given path.
<static>  
jls.net.http.HttpServer.createFolderPage(reqPath, filenames)
A basic folder page generation implementation.
<static>  
jls.net.http.HttpServer.defaultHandler(httpExchange)
A default handler implementation with the HTTP status: not found.
<static>  
jls.net.http.HttpServer.fileHandler(httpExchange)
A basic file handler implementation.
Class Detail
jls.net.http.HttpServer()
Creates a HTTP server.
Field Detail
<static> jls.net.http.HttpServer.defaultContentTypes
Default content type objects.
Method Detail
<static> jls.net.http.HttpServer.bodyHandler(httpExchange)
A basic body handler implementation. Parameters:
requestHandler
The function to call once the body has been read
Parameters:
{jls.net.http.HttpExchange} httpExchange
The socket address.

<static> {jls.net.http.HttpServer} jls.net.http.HttpServer.create(addr, backlog)
Creates a HTTP server for a specified socket address.
Parameters:
{jls.net.InetSocketAddress} addr
The socket address.
{Number} backlog Optional
The backlog.
Returns:
{jls.net.http.HttpServer} the created HTTP server.

{jls.net.http.HttpContext} createContext(path, handler)
Creates a context at the given path.
Parameters:
{String} path
The path of the context.
{Function} handler Optional
The handler of the context.
Returns:
{jls.net.http.HttpContext} the created context.

<static> {String} jls.net.http.HttpServer.createFolderPage(reqPath, filenames)
A basic folder page generation implementation.
Parameters:
{String} reqPath
The folder request path.
{Array} filenames
The file name list.
Returns:
{String} The HTML content.

<static> jls.net.http.HttpServer.defaultHandler(httpExchange)
A default handler implementation with the HTTP status: not found.
Parameters:
{jls.net.http.HttpExchange} httpExchange
The socket address.

<static> jls.net.http.HttpServer.fileHandler(httpExchange)
A basic file handler implementation. Parameters:
rootFile
The root path to look for files
contentTypes
The extention / content type mapping to use
createFolderPage
A function to generate a folder page
Parameters:
{jls.net.http.HttpExchange} httpExchange
The socket address.

Documentation generated by JsDoc Toolkit 2.3.2 on Sat Jan 08 2011 02:00:14 GMT+0100 (CET)