From cf72fece6db782530086724cd704261ccfb8c986 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 18 Dec 2010 18:23:51 -0800 Subject: Replaced the HttpServer_OpenSim.dll with one compiled for .NET 3.5 (the last one was 4.0, and that doesn't work). Also added the corresponding .xml and .pdb, if that makes any difference. --- bin/HttpServer_OpenSim.dll | Bin 116224 -> 115712 bytes bin/HttpServer_OpenSim.pdb | Bin 382464 -> 409088 bytes bin/HttpServer_OpenSim.xml | 6316 ++++++++++++++++++++++---------------------- 3 files changed, 3158 insertions(+), 3158 deletions(-) diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index cdd4655..d7503a0 100644 Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb index 7c00e66..4151588 100644 Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml index 9c3df78..27386b7 100644 --- a/bin/HttpServer_OpenSim.xml +++ b/bin/HttpServer_OpenSim.xml @@ -4,492 +4,494 @@ HttpServer_OpenSim - + - Inversion of control interface. + The request could not be understood by the server due to malformed syntax. + The client SHOULD NOT repeat the request without modifications. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - + - Add a component instance + All HTTP based exceptions will derive this class. - Interface type - Instance to add - + - Get a component. + Create a new HttpException - Interface type - Component if registered, otherwise null. - - Component will get created if needed. - + http status code (sent in the response) + error description - + - Checks if the specified component interface have been added. + Create a new HttpException - - true if found; otherwise false. + http status code (sent in the response) + error description + inner exception - + - Add a component. + status code to use in the response. - Type being requested. - Type being created. - + - A HttpModule can be used to serve Uri's. The module itself - decides if it should serve a Uri or not. In this way, you can - get a very flexible http application since you can let multiple modules - serve almost similar urls. + Create a new bad request exception. - - Throw if you are using a and want to prompt for user name/password. - + reason to why the request was bad. - + - Method that process the url + Create a new bad request exception. - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - true if this module handled the request. + reason to why the request was bad. + inner exception - + - Set the log writer to use. + Implements HTTP Digest authentication. It's more secure than Basic auth since password is + encrypted with a "key" from the server. - logwriter to use. + + Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. + - + - Log something. + Authentication modules are used to implement different + kind of HTTP authentication. - importance of log message - message - + - If true specifies that the module doesn't consume the processing of a request so that subsequent modules - can continue processing afterwards. Default is false. + Tag used for authentication. - + - Container to bind resource names to assemblies + Initializes a new instance of the class. + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). - + - Instantiates an instance of + Initializes a new instance of the class. - The dot seperated uri the resource maps to - The full resource name - The assembly the resource exists in + Delegate used to provide information used during authentication. - + - Retrieves a stream to the resource + Create a response that can be sent in the WWW-Authenticate header. - Null if the resource couldn't be located somehow + Realm that the user should authenticate in + Array with optional options. + A correct authentication request. + If realm is empty or null. - + - Retrieves the assembly the resource resides in + An authentication response have been received from the web browser. + Check if it's correct + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + options to specific implementations + Authentication object that is stored for the request. A user class or something like that. + if is invalid + If any of the parameters is empty or null. - + - Retrieves the full name/path of the assembly + Used to invoke the authentication delegate that is used to lookup the user name/realm. + Realm (domain) that user want to authenticate in + User name + Password used for validation. Some implementations got password in clear text, they are then sent to client. + object that will be stored in the request to help you identify the user if authentication was successful. + true if authentication was successful - + - Retrieves the extension of the resource + Determines if authentication is required. + HTTP request from browser + true if user should be authenticated. + throw from your delegate if no more attempts are allowed. + If no more attempts are allowed - - Returns the Uri without extension - - - Retrieves the full path name to the resource file - - + - The object form class takes an object and creates form items for it. + name used in HTTP request. - + - Initializes a new instance of the class. + Initializes a new instance of the class. - - form name *and* id. - action to do when form is posted. - + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). - + - Initializes a new instance of the class. + Initializes a new instance of the class. - form name *and* id. - action to do when form is posted. - object to get values from + Delegate used to provide information used during authentication. - + - Initializes a new instance of the class. + Used by test classes to be able to use hardcoded values - form action. - object to get values from. - + - write out the FORM-tag. + An authentication response have been received from the web browser. + Check if it's correct - generated html code + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + First option: true if username/password is correct but not cnonce + + Authentication object that is stored for the request. A user class or something like that. + + if authenticationHeader is invalid + If any of the paramters is empty or null. - + - Writeout the form tag + Encrypts parameters into a Digest string - form should be posted through ajax. - generated html code + Realm that the user want to log into. + User logging in + Users password. + HTTP method. + Uri/domain that generated the login prompt. + Quality of Protection. + "Number used ONCE" + Hexadecimal request counter. + "Client Number used ONCE" + Digest encrypted string - + - Generates a text box. + - - - generated html code + Md5 hex encoded "userName:realm:password", without the quotes. + Md5 hex encoded "method:uri", without the quotes + Quality of Protection + "Number used ONCE" + Hexadecimal request counter. + Client number used once + - + - password box + Create a response that can be sent in the WWW-Authenticate header. - - - generated html code + Realm that the user should authenticate in + First options specifies if true if username/password is correct but not cnonce. + A correct auth request. + If realm is empty or null. - + - Hiddens the specified property name. + Decodes authorization header value - Name of the property. - The options. - generated html code + header value + Encoding that the buffer is in + All headers and their values if successful; otherwise null + + NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); + + Can handle lots of whitespaces and new lines without failing. - + - Labels the specified property name. + Gets the current nonce. - property in object. - caption - generated html code + - + - Generate a checkbox + Gets the Md5 hash bin hex2. - property in object - checkbox value - additional html attributes. - generated html code + To be hashed. + - - - Write a html select tag - - object property. - id column - The title column. - The options. - - - + - Selects the specified property name. + determines if the nonce is valid or has expired. - Name of the property. - The items. - The id column. - The title column. - The options. - + nonce value (check wikipedia for info) + true if the nonce has not expired. - + - Write a submit tag. + name used in http request. - button caption - html submit tag - + - html end form tag + Gets or sets whether the token supplied in is a + HA1 generated string. - html - + - This decoder converts XML documents to form items. - Each element becomes a subitem in the form, and each attribute becomes an item. + Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules + a regular expression can be used to identify redirect URLs and their targets. - // xml: somethingdata - // result: - // form["hello"].Value = "something" - // form["hello"]["id"].Value = 1 - // form["hello"]["world]["id"].Value = 1 - // form["hello"]["world"].Value = "data" + [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) + ]]> - - The original xml document is stored in form["__xml__"].Value. - - + - Interface for form content decoders. + redirects from one URL to another. - + - + Rules are used to perform operations before a request is being handled. + Rules can be used to create routing etc. - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream enconding - A http form, or null if content could not be parsed. - If contents in the stream is not valid input data. - + - Checks if the decoder can handle the mime type + Process the incoming request. - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + + If request or response is null. - + - + Initializes a new instance of the class. - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream encoding - Note: contentType and encoding are not used? - A http form, or null if content could not be parsed. - + Absolute path (no server name) + Absolute path (no server name) + + server.Add(new RedirectRule("/", "/user/index")); + - + - Recursive function that will go through an xml element and store it's content - to the form item. + Initializes a new instance of the class. - (parent) Item in form that content should be added to. - Node that should be parsed. + Absolute path (no server name) + Absolute path (no server name) + true if request should be redirected, false if the request URI should be replaced. + + server.Add(new RedirectRule("/", "/user/index")); + - + - Checks if the decoder can handle the mime type + Process the incoming request. - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + - + - The server encountered an unexpected condition which prevented it from fulfilling the request. + Gets string to match request URI with. + Is compared to request.Uri.AbsolutePath - + - All HTTP based exceptions will derive this class. + Gets where to redirect. - + - Create a new HttpException + Gets whether server should redirect client. - http status code (sent in the response) - error description + + false means that the rule will replace + the current request URI with the new one from this class. + true means that a redirect response is sent to the client. + - + - Create a new HttpException + Initializes a new instance of the class. - http status code (sent in the response) - error description - inner exception + Expression to match URL + Expression to generate URL + + [a-zA-Z0-9]+)", "/user/${first}")); + Result of ie. /employee1 will then be /user/employee1 + ]]> + - + - status code to use in the response. + Initializes a new instance of the class. + Expression to match URL + Expression to generate URL + Regular expression options to use, can be null + + [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + - + - Initializes a new instance of the class. + Initializes a new instance of the class. + Expression to match URL + Expression to generate URL + Regular expression options to apply + true if request should be redirected, false if the request URI should be replaced. + + [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + + Argument is null. + - + - Initializes a new instance of the class. + Process the incoming request. - error message. + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + + If request or response is null - + - Initializes a new instance of the class. + We dont want to let the server to die due to exceptions thrown in worker threads. + therefore we use this delegate to give you a change to handle uncaught exceptions. - error message. - inner exception. + Class that the exception was thrown in. + Exception + + Server will throw a InternalServerException in release version if you dont + handle this delegate. + - + - Session store using memory for each session. + Delegate used to let authentication modules authenticate the user name and password. + Realm that the user want to authenticate in + User name specified by client + Can either be user password or implementation specific token. + object that will be stored in a session variable called if authentication was successful. + throw forbidden exception if too many attempts have been made. + + + Use to specify that the token is a HA1 token. (MD5 generated + string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); + + - + - A session store is used to store and load sessions on a media. - The default implementation () saves/retrieves sessions from memory. + Let's you decide on a system level if authentication is required. + HTTP request from client + true if user should be authenticated. + throw if no more attempts are allowed. + If no more attempts are allowed - + - Creates a new http session with a generated id. + Interface for sessions - A object - + - Creates a new http session with a specific id + Remove everything from the session - Id used to identify the new cookie.. - A object. - - Id should be generated by the store implementation if it's null or . - - + - Load an existing session. + Remove everything from the session - Session id (usually retrieved from a client side cookie). - A session if found; otherwise null. + True if the session is cleared due to expiration - - - Save an updated session to the store. - - Session id (usually retrieved from a client side cookie). - If Id property have not been specified. - - - - We use the flyweight pattern which reuses small objects - instead of creating new each time. - - Unused session that should be reused next time Create is called. - - - - Remove expired sessions - - - - - Remove a session - - id of the session. - - - - Load a session from the store - - - null if session is not found. - - - - Number of minutes before a session expires. - - Default time is 20 minutes. - - - - Initializes the class setting the expirationtimer to clean the session every minute - - - - - Delegate for the cleanup timer - - - + - Creates a new http session + Session id - - + - Creates a new http session with a specific id + Should - Id used to identify the new cookie.. - A object. - - Id should be generated by the store implementation if it's null or . - + Name of the session variable + null if it's not set + If the object cant be serialized. - + - Load an existing session. + When the session was last accessed. + This property is touched by the http server each time the + session is requested. - - - + - Save an updated session to the store. + Number of session variables. - - + - We use the flyweight pattern which reuses small objects - instead of creating new each time. + Event triggered upon clearing the session - EmptyLanguageNode (unused) session that should be reused next time Create is called. - + - Remove expired sessions + Arguments sent when a is cleared - + - Remove a session + Instantiates the arguments for the event - id of the session. + True if the session is cleared due to expiration - + - Load a session from the store + Returns true if the session is cleared due to expiration - - null if session is not found. - + - Number of minutes before a session expires. - Default is 20 minutes. + Delegate for when a IHttpSession is cleared + this is being cleared. + Arguments for the clearing @@ -541,35 +543,29 @@ Gets the cookie of a given identifier (null if not existing). - + - Small design by contract implementation. + Creates request parsers when needed. - + - Check whether a parameter is empty. + Creates request parsers when needed. - Parameter value - Parameter name, or error description. - value is empty. - + - Checks whether a parameter is null. + Create a new request parser. - Parameter value - Parameter name, or error description. - value is null. + Used when logging should be enabled. + A new request parser. - + - Checks whether a parameter is null. + Create a new request parser. - - Parameter value - Parameter name, or error description. - value is null. + Used when logging should be enabled. + A new request parser. @@ -707,33 +703,20 @@ A header have been received. - - - The website module let's you handle multiple websites in the same server. - It uses the "Host" header to check which site you want. - - It's recommended that you do not - add any other modules to HttpServer if you are using the website module. Instead, - add all wanted modules to each website. - - + - + Used to inform http server that - domain name that should be handled. - - + - Method that process the url + Eventarguments used when an exception is thrown by a module - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to + the exception - + - Name of site. + Exception thrown in a module @@ -927,1888 +910,1769 @@ 0 if no files are added - + - The request could not be understood by the server due to malformed syntax. - The client SHOULD NOT repeat the request without modifications. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php + Interface for form content decoders. - + - Create a new bad request exception. + - reason to why the request was bad. + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream enconding + A http form, or null if content could not be parsed. + If contents in the stream is not valid input data. - + - Create a new bad request exception. + Checks if the decoder can handle the mime type - reason to why the request was bad. - inner exception + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type - + - A session stored in memory. + Lists content type mime types. - + - Interface for sessions + text/plain - + - Remove everything from the session + text/haml - + - Remove everything from the session + content type for javascript documents = application/javascript - True if the session is cleared due to expiration + + + RFC 4329 states that text/javascript have been superseeded by + application/javascript. You might still want to check browser versions + since older ones do not support application/javascript. + + Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/ + - + - Session id + text/xml - + - Should + A list of content types - Name of the session variable - null if it's not set - If the object cant be serialized. - + - When the session was last accessed. - This property is touched by the http server each time the - session is requested. + + Semicolon separated content types. - + - Number of session variables. + Returns an enumerator that iterates through a collection. + + An object that can be used to iterate through the collection. + - + - Event triggered upon clearing the session + Searches for the specified type + Can also be a part of a type (searching for "xml" would return true for "application/xml"). + true if type was found. - + - + Get this first content type. - A unique id used by the sessions store to identify the session - + - Id + Fetch a content type - - - + Part of type ("xml" would return "application/xml") + + All content types are in lower case. + + - Remove everything from the session + A HttpModule can be used to serve Uri's. The module itself + decides if it should serve a Uri or not. In this way, you can + get a very flexible http application since you can let multiple modules + serve almost similar urls. + + Throw if you are using a and want to prompt for user name/password. + - + - Clears the specified expire. + Method that process the url - True if the session is cleared due to expiration + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + true if this module handled the request. - + - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + Set the log writer to use. - 2 + logwriter to use. - + - Session id + Log something. + importance of log message + message - + - Should + If true specifies that the module doesn't consume the processing of a request so that subsequent modules + can continue processing afterwards. Default is false. - Name of the session variable - null if it's not set - + - when the session was last accessed. + Webhelper provides helpers for common tasks in HTML. - - Used to determine when the session should be removed. - - + - Number of values in the session + Used to let the website use different javascript libraries. + Default is - + - Flag to indicate that the session have been changed - and should be saved into the session store. + Creates a link that invokes through ajax. + url to fetch + link title + + optional options in format "key, value, key, value". + Javascript options starts with ':'. + + a link tag + + WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); + - + - Event triggered upon clearing the session + Builds a link that updates an element with the fetched ajax content. + Url to fetch content from + link title + html element to update with the results of the ajax request. + optional options in format "key, value, key, value" + A link tag. - + - redirects from one URL to another. + A link that pop ups a Dialog (overlay div) + url to contents of dialog + link title + name/value of html attributes. + A "a"-tag that popups a dialog when clicked + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + - + - Rules are used to perform operations before a request is being handled. - Rules can be used to create routing etc. + Create/Open a dialog box using ajax + + + + - + - Process the incoming request. + Close a javascript dialog window/div. - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - - If request or response is null. + javascript for closing a dialog. + - + - Initializes a new instance of the class. + Create a <form> tag. - Absolute path (no server name) - Absolute path (no server name) + name of form + action to invoke on submit + form should be posted as ajax + html code - server.Add(new RedirectRule("/", "/user/index")); + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - + - Initializes a new instance of the class. + Create a link tag. - Absolute path (no server name) - Absolute path (no server name) - true if request should be redirected, false if the request URI should be replaced. + url to go to + link title (text that is displayed) + html attributes, name, value, name, value + html code - server.Add(new RedirectRule("/", "/user/index")); + WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); - + - Process the incoming request. + Build a link - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - + url to go to. + title of link (displayed text) + extra html attributes. + a complete link - + - Gets string to match request URI with. + Build a link - Is compared to request.Uri.AbsolutePath + url to go to. + title of link (displayed text) + extra html attributes. + a complete link + more options - + - Gets where to redirect. + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete - + - Gets whether server should redirect client. + Obsolete - - false means that the rule will replace - the current request URI with the new one from this class. - true means that a redirect response is sent to the client. - + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete - + - cookie sent by the client/browser + Render errors into a UL with class "errors" - + class used by UL-tag. + items to list + an unordered html list. - + - Constructor. + Render errors into a UL with class "errors" - cookie identifier - cookie content - id or content is null - id is empty + class used by UL-tag. + items to list + an unordered html list. - + - Gets the cookie HTML representation. + Render errors into a UL with class "errors" - cookie string + + - + - Gets the cookie identifier. + Generates a list with html attributes. + StringBuilder that the options should be added to. + attributes set by user. + attributes set by any of the helper classes. - + - Cookie value. Set to null to remove cookie. + Generates a list with html attributes. + StringBuilder that the options should be added to. + - + - Priority for log entries + Purpose of this class is to create a javascript toolkit independent javascript helper. - - + - Very detailed logs to be able to follow the flow of the program. + Generates a list with JS options. + StringBuilder that the options should be added to. + the javascript options. name, value pairs. each string value should be escaped by YOU! + true if we should start with a comma. - + - Logs to help debug errors in the application + Removes any javascript parameters from an array of parameters + The array of parameters to remove javascript params from + An array of html parameters - + - Information to be able to keep track of state changes etc. + javascript action that should be added to the "onsubmit" event in the form tag. + + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + - + - Something did not go as we expected, but it's no problem. + Requests a url through ajax + url to fetch + optional options in format "key, value, key, value", used in JS request object. + a link tag + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + - + - Something that should not fail failed, but we can still keep - on going. + Ajax requests that updates an element with + the fetched content + Url to fetch content from + element to update + optional options in format "key, value, key, value", used in JS updater object. + A link tag. + All javascript option names should end with colon. + + + JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); + + - + - Something failed, and we cannot handle it properly. + A link that pop ups a Dialog (overlay div) + url to contents of dialog + link title + A "a"-tag that popups a dialog when clicked + name/value of html attributes + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + - + - Interface used to write to log files. + Close a javascript dialog window/div. + javascript for closing a dialog. + - + - Write an entry to the log file. + Creates a new modal dialog window - object that is writing to the log - importance of the log message - the message + url to open in window. + window title (may not be supported by all js implementations) + + - + - This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) + Class that receives Requests from a . - - + - The actual instance of this class. + Client have been disconnected. + Client that was disconnected. + Reason + - + - Logwriters the specified source. + Invoked when a client context have received a new HTTP request - object that wrote the logentry. - Importance of the log message - The message. + Client that received the request. + Request that was received. + - + - Get color for the specified logprio + Generic helper functions for HTTP - prio for the log entry - A for the prio - + - Default log writer, writes everything to null (nowhere). + Version string for HTTP v1.0 - - + - The logging instance. + Version string for HTTP v1.1 - + - Writes everything to null + An empty URI - object that wrote the log entry. - Importance of the log message - The message. - + - Class that receives Requests from a . + Parses a query string. + Query string (URI encoded) + A object if successful; otherwise + queryString is null. + If string cannot be parsed. - + - Client have been disconnected. + This provider is used to let us implement any type of form decoding we want without + having to rewrite anything else in the server. - Client that was disconnected. - Reason - - + - Invoked when a client context have received a new HTTP request + - Client that received the request. - Request that was received. - + Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959 + Stream containing form data. + Encoding used when decoding the stream + if no parser was found. + If stream is null or not readable. + If stream contents cannot be decoded properly. - + - Will contain helper functions for javascript. + Add a decoder. + + - + - Requests a url through ajax + Number of added decoders. - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. - a link tag - onclick attribute is used by this method. - - - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); + + + + Use with care. + + + + + Decoder used for unknown content types. + + + + + A session stored in memory. + + + + - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - - + + A unique id used by the sessions store to identify the session - + - Ajax requests that updates an element with - the fetched content + Id - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - element to update - options in format "key, value, key, value". All keys should end with colon. - A link tag. - - - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - - + - + - Opens contents in a dialog window. + Remove everything from the session - url to contents of dialog - link title - name, value, name, value, all parameter names should end with colon. - + - Close a javascript dialog window/div. + Clears the specified expire. - javascript for closing a dialog. - + True if the session is cleared due to expiration - + - Helpers making it easier to work with forms. + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - + 2 - + - Used to let the website use different JavaScript libraries. - Default is + Session id - + - Create a <form> tag. + Should - name of form - action to invoke on submit - form should be posted as Ajax - HTML code - - - // without options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - - // with options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); - - - HTML attributes or JavaScript options. - Method will ALWAYS be POST. - options must consist of name, value, name, value + Name of the session variable + null if it's not set - + - Creates a select list with the values in a collection. + when the session was last accessed. - Name of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - string containing a SELECT-tag. - + + Used to determine when the session should be removed. + - + - Creates a select list with the values in a collection. + Number of values in the session - Name of the SELECT-tag - Id of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - string containing a SELECT-tag. - - - - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } - - - name, id, collection or getIdTitle is null. - - - - Creates a select list with the values in a collection. - - Name of the SELECT-tag - Id of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - name, value collection of extra HTML attributes. - string containing a SELECT-tag. - - name, id, collection or getIdTitle is null. - Invalid HTML attribute list. - + - Generate a list of HTML options + Flag to indicate that the session have been changed + and should be saved into the session store. - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - - collection or getIdTitle is null. - - sb is null. - - + - Creates a check box. + Event triggered upon clearing the session - element name - element value - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - + - Creates a check box. + This decoder converts XML documents to form items. + Each element becomes a subitem in the form, and each attribute becomes an item. - element name - element id - element value - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button + + // xml: somethingdata + // result: + // form["hello"].Value = "something" + // form["hello"]["id"].Value = 1 + // form["hello"]["world]["id"].Value = 1 + // form["hello"]["world"].Value = "data" + - value in your business object. (check box will be selected if it matches the element value) + The original xml document is stored in form["__xml__"].Value. - + - Creates a check box. + - element name - element id - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - will set value to "1". + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream encoding + Note: contentType and encoding are not used? + A http form, or null if content could not be parsed. + - + - Creates a RadioButton. + Recursive function that will go through an xml element and store it's content + to the form item. - element name - element value - determines if the radio button is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button + (parent) Item in form that content should be added to. + Node that should be parsed. - + - Creates a RadioButton. + Checks if the decoder can handle the mime type - element name - element id - element value - determines if the radio button is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type - + - form close tag + + + - + + Represents a field in a multipart form + + - Arguments sent when a is cleared + The server encountered an unexpected condition which prevented it from fulfilling the request. - + - Instantiates the arguments for the event + Initializes a new instance of the class. - True if the session is cleared due to expiration - + - Returns true if the session is cleared due to expiration + Initializes a new instance of the class. + error message. - + - Delegate for when a IHttpSession is cleared + Initializes a new instance of the class. - this is being cleared. - Arguments for the clearing + error message. + inner exception. - + - Used to queue incoming requests. + Current state in the parsing. - + - Initializes a new instance of the class. + Should parse the request line - Called when a request should be processed. - + - Used to process queued requests. + Searching for a complete header name - + - Gets or sets maximum number of allowed simultaneous requests. + Searching for colon after header name (ignoring white spaces) - + - Gets or sets maximum number of requests queuing to be handled. + Searching for start of header value (ignoring white spaces) - + - Specifies how many requests the HTTP server is currently processing. + Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) - + - Used two queue incoming requests to avoid - thread starvation. + Adding bytes to body - + - Method used to process a queued request + A reverse proxy are used to act as a bridge between local (protected/hidden) websites + and public clients. + + A typical usage is to allow web servers on non standard ports to still be available + to the public clients, or allow web servers on private ips to be available. - Context that the request was received from. - Request to process. - + - Creates request parsers when needed. + + Base url requested from browser + Base url on private web server + + // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas + _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); + - + - Creates request parsers when needed. + Method that determines if an url should be handled or not by the module + Url requested by the client. + true if module should handle the url. - + - Create a new request parser. + Method that process the url - Used when logging should be enabled. - A new request parser. + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to - + - Create a new request parser. + Contains all HTTP Methods (according to the HTTP 1.1 specification) + + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + - Used when logging should be enabled. - A new request parser. - + - Response that is sent back to the web browser / client. + The DELETE method requests that the origin server delete the resource identified by the Request-URI. - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - - The second and slightly more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set and before doing so. + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + + + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + + + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. - - - // Example using response body. - class MyModule : HttpModule - { - public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) - { - StreamWriter writer = new StreamWriter(response.Body); - writer.WriteLine("Hello dear World!"); - writer.Flush(); - - // return true to tell webserver that we've handled the url - return true; - } - } - - - todo: add two examples, using SendHeaders/SendBody and just the Body stream. - - - - Response that is sent back to the web browser / client. - - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - - The second and slighty more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set ContentType and ContentLength before doing so. - - - public void MyHandler(IHttpRequest request, IHttpResponse response) - { - - } - - - - - Add another header to the document. - - Name of the header, case sensitive, use lower cases. - Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n - If headers already been sent. - If value conditions have not been met. - Adding any header will override the default ones and those specified by properties. - - - - Send headers and body to the browser. - - If content have already been sent. - - - - Make sure that you have specified ContentLength and sent the headers first. - - - If headers have not been sent. - - offest of first byte to send - number of bytes to send. - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Make sure that you have specified ContentLength and sent the headers first. - - - If headers have not been sent. - - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Send headers to the client. - - If headers already been sent. - - - - - - - Redirect client to somewhere else using the 302 status code. - - Destination of the redirect - If headers already been sent. - You can not do anything more with the request when a redirect have been done. This should be your last - action. - + - redirect to somewhere + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. - where the redirect should go - No body are allowed when doing redirects. + + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + + + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + - - - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. - - - - - Defines the version of the HTTP Response for applications where it's required - for this to be forced. - - - - - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. - - - - - Kind of connection - - - - - Encoding to use when sending stuff to the client. - - Default is UTF8 - - - - Number of seconds to keep connection alive - - Only used if Connection property is set to ConnectionType.KeepAlive - - - - Status code that is sent to the client. - - Default is HttpStatusCode.Ok - - - - Information about why a specific status code was used. - - - - - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. - - - - - Kind of content in the body - - Default is text/html - - - - Headers have been sent to the client- - - You can not send any additional headers if they have already been sent. - - - - The whole response have been sent. - - - - - Cookies that should be created/changed. - - - - - Initializes a new instance of the class. - - Client that send the . - Contains information of what the client want to receive. - cannot be empty. - - - - Initializes a new instance of the class. - - Client that send the . - Version of HTTP protocol that the client uses. - Type of HTTP connection used. - - - - Add another header to the document. - - Name of the header, case sensitive, use lower cases. - Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n - If headers already been sent. - If value conditions have not been met. - Adding any header will override the default ones and those specified by properties. - - - - Send headers and body to the browser. - - If content have already been sent. - - - - Make sure that you have specified and sent the headers first. - - - If headers have not been sent. - - offset of first byte to send - number of bytes to send. - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Make sure that you have specified and sent the headers first. - - - If headers have not been sent. - - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Send headers to the client. - - If headers already been sent. - - - - - - - Redirect client to somewhere else using the 302 status code. - - Destination of the redirect - If headers already been sent. - You can not do anything more with the request when a redirect have been done. This should be your last - action. - - + - redirect to somewhere + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - where the redirect should go - No body are allowed when doing redirects. + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. + + This method is often used for testing hypertext links for validity, accessibility, and recent modification. - - - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. - - - + - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. + The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + + This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. + - + - Defines the version of the HTTP Response for applications where it's required - for this to be forced. + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + + POST is designed to allow a uniform method to cover the following functions: + + + Annotation of existing resources; + + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + + Providing a block of data, such as the result of submitting a form, to a data-handling process; + + Extending a database through an append operation. + + + + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + + + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + + - + - Kind of connection + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + + + + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + + + + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + + - + - Encoding to use when sending stuff to the client. + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - Default is UTF8 - + - Number of seconds to keep connection alive + Contains all HTTP Methods (according to the HTTP 1.1 specification) + + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + - Only used if Connection property is set to . - + - Status code that is sent to the client. + The DELETE method requests that the origin server delete the resource identified by the Request-URI. - Default is + + + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + + + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + + + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. + + - + - Information about why a specific status code was used. + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + + + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + + + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + + - + - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. + + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + - + - Kind of content in the body + The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. - Default type is "text/html" + + This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. + - + - Headers have been sent to the client- + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. - You can not send any additional headers if they have already been sent. + + POST is designed to allow a uniform method to cover the following functions: + + + Annotation of existing resources; + + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + + Providing a block of data, such as the result of submitting a form, to a data-handling process; + + Extending a database through an append operation. + + + + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + + + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + + - + - The whole response have been sent. + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + + + + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + + + + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + + - + - Cookies that should be created/changed. + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - + - Used to create and reuse contexts. + New implementation of the HTTP listener. + + Use the Create methods to create a default listener. + - + - Used to create es. + Contains a listener that doesn't do anything with the connections. - + - Creates a that handles a connected client. + Listen for regular HTTP connections - Client socket (accepted by the ). - A creates . + IP Address to accept connections on + TCP Port to listen on, default HTTP port is 80. + Factory used to create es. + address is null. + Port must be a positive number. - + - Create a secure . + Initializes a new instance of the class. - Client socket (accepted by the ). - HTTPS certificate to use. - Kind of HTTPS protocol. Usually TLS or SSL. - A created . + IP Address to accept connections on + TCP Port to listen on, default HTTPS port is 443 + Factory used to create es. + Certificate to use - + - A request have been received from one of the contexts. + Initializes a new instance of the class. + IP Address to accept connections on + TCP Port to listen on, default HTTPS port is 443 + Factory used to create es. + Certificate to use + which HTTPS protocol to use, default is TLS. - + + Exception. + + - Initializes a new instance of the class. + Will try to accept connections one more time. - The writer. - Amount of bytes to read from the incoming socket stream. - Used to create a request parser. + If any exceptions is thrown. - + - Create a new context. + Can be used to create filtering of new connections. - true if socket is running HTTPS. - Client that connected - Network/SSL stream. - A context. + Accepted socket + true if connection can be accepted; otherwise false. - + - Create a new context. + Start listen for new connections - true if HTTPS is used. - Remote client - Network stream, uses . - A new context (always). + Number of connections that can stand in a queue to be accepted. + Listener have already been started. - + - Create a secure . + Stop the listener - Client socket (accepted by the ). - HTTPS certificate to use. - Kind of HTTPS protocol. Usually TLS or SSL. - - A created . - + - + - Creates a that handles a connected client. + Gives you a change to receive log entries for all internals of the HTTP library. - Client socket (accepted by the ). - - A creates . - + + You may not switch log writer after starting the listener. + - + - True if detailed trace logs should be written. + True if we should turn on trace logs. - + - A request have been received from one of the contexts. + Catch exceptions not handled by the listener. + + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + - + - Custom network stream to mark sockets as reusable when disposing the stream. + A request have been received from a . - + - Creates a new instance of the class for the specified . + Initializes a new instance of the class. - - The that the will use to send and receive data. - - - The parameter is null. - - - The parameter is not connected. - -or- - The property of the parameter is not . - -or- - The parameter is in a nonblocking state. - + IP Address to accept connections on + TCP Port to listen on, default HTTP port is 80. + Factory used to create es. + address is null. + Port must be a positive number. - + - Initializes a new instance of the class for the specified with the specified ownership. + Initializes a new instance of the class. - - The that the will use to send and receive data. - - - Set to true to indicate that the will take ownership of the ; otherwise, false. - - - The parameter is null. - - - The parameter is not connected. - -or- - the value of the property of the parameter is not . - -or- - the parameter is in a nonblocking state. - + The address. + The port. + The factory. + The certificate. - + - Creates a new instance of the class for the specified with the specified access rights. + Initializes a new instance of the class. - - The that the will use to send and receive data. - - - A bitwise combination of the values that specify the type of access given to the over the provided . - - - The parameter is null. - - - The parameter is not connected. - -or- - the property of the parameter is not . - -or- - the parameter is in a nonblocking state. - + The address. + The port. + The factory. + The certificate. + The protocol. - + - Creates a new instance of the class for the specified with the specified access rights and the specified ownership. + Creates a new instance with default factories. - - The that the will use to send and receive data. - - - A bitwise combination of the values that specifies the type of access given to the over the provided . - - - Set to true to indicate that the will take ownership of the ; otherwise, false. - - - The parameter is null. - - - The parameter is not connected. - -or- - The property of the parameter is not . - -or- - The parameter is in a nonblocking state. - + Address that the listener should accept connections on. + Port that listener should accept connections on. + Created HTTP listener. - + - Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + Creates a new instance with default factories. + Address that the listener should accept connections on. + Port that listener should accept connections on. + Certificate to use + Created HTTP listener. - + - Releases the unmanaged resources used by the and optionally releases the managed resources. + Creates a new instance with default factories. - true to release both managed and unmanaged resources; false to release only unmanaged resources. + Address that the listener should accept connections on. + Port that listener should accept connections on. + Certificate to use + which HTTPS protocol to use, default is TLS. + Created HTTP listener. - + - The "basic" authentication scheme is based on the model that the - client must authenticate itself with a user-ID and a password for - each realm. The realm value should be considered an opaque string - which can only be compared for equality with other realms on that - server. The server will service the request only if it can validate - the user-ID and password for the protection space of the Request-URI. - There are no optional authentication parameters. + Can be used to create filtering of new connections. + Accepted socket + + true if connection can be accepted; otherwise false. + - + - Authentication modules are used to implement different - kind of HTTP authentication. + A client have been accepted, but not handled, by the listener. - + - Tag used for authentication. + Event arguments used when a new header have been parsed. - + - Initializes a new instance of the class. + Initializes a new instance of the class. - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). + Name of header. + Header value. - + - Initializes a new instance of the class. + Initializes a new instance of the class. - Delegate used to provide information used during authentication. - + - Create a response that can be sent in the WWW-Authenticate header. + Gets or sets header name. - Realm that the user should authenticate in - Array with optional options. - A correct authentication request. - If realm is empty or null. - + - An authentication response have been received from the web browser. - Check if it's correct + Gets or sets header value. - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - options to specific implementations - Authentication object that is stored for the request. A user class or something like that. - if is invalid - If any of the parameters is empty or null. - + - Used to invoke the authentication delegate that is used to lookup the user name/realm. + Priority for log entries - Realm (domain) that user want to authenticate in - User name - Password used for validation. Some implementations got password in clear text, they are then sent to client. - object that will be stored in the request to help you identify the user if authentication was successful. - true if authentication was successful + - + - Determines if authentication is required. + Very detailed logs to be able to follow the flow of the program. - HTTP request from browser - true if user should be authenticated. - throw from your delegate if no more attempts are allowed. - If no more attempts are allowed - + - name used in HTTP request. + Logs to help debug errors in the application - + - Initializes a new instance of the class. + Information to be able to keep track of state changes etc. - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). - + - Initializes a new instance of the class. + Something did not go as we expected, but it's no problem. - Delegate used to provide information used during authentication. - + - Create a response that can be sent in the WWW-Authenticate header. + Something that should not fail failed, but we can still keep + on going. - Realm that the user should authenticate in - Not used in basic auth - A correct auth request. - + - An authentication response have been received from the web browser. - Check if it's correct + Something failed, and we cannot handle it properly. - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - Not used in basic auth - Authentication object that is stored for the request. A user class or something like that. - if authenticationHeader is invalid - If any of the paramters is empty or null. - + - name used in http request. + Interface used to write to log files. - + - Used to inform http server that + Write an entry to the log file. + object that is writing to the log + importance of the log message + the message - + - Eventarguments used when an exception is thrown by a module + This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) - the exception + - + - Exception thrown in a module + The actual instance of this class. - + - PrototypeJS implementation of the javascript functions. + Logwriters the specified source. + object that wrote the logentry. + Importance of the log message + The message. - + - Purpose of this class is to create a javascript toolkit independent javascript helper. + Get color for the specified logprio + prio for the log entry + A for the prio - + - Generates a list with JS options. + Default log writer, writes everything to null (nowhere). - StringBuilder that the options should be added to. - the javascript options. name, value pairs. each string value should be escaped by YOU! - true if we should start with a comma. + - + - Removes any javascript parameters from an array of parameters + The logging instance. + + + + + Writes everything to null - The array of parameters to remove javascript params from - An array of html parameters + object that wrote the log entry. + Importance of the log message + The message. - + - javascript action that should be added to the "onsubmit" event in the form tag. + Will contain helper functions for javascript. - - All javascript option names should end with colon. - - - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - - - + Requests a url through ajax - url to fetch - optional options in format "key, value, key, value", used in JS request object. + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. + optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. a link tag - All javascript option names should end with colon. + onclick attribute is used by this method. - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - + Ajax requests that updates an element with the fetched content - Url to fetch content from + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. element to update - optional options in format "key, value, key, value", used in JS updater object. + options in format "key, value, key, value". All keys should end with colon. A link tag. - All javascript option names should end with colon. - JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - + - A link that pop ups a Dialog (overlay div) + Opens contents in a dialog window. url to contents of dialog link title - A "a"-tag that popups a dialog when clicked - name/value of html attributes - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - + name, value, name, value, all parameter names should end with colon. - + Close a javascript dialog window/div. javascript for closing a dialog. - + - + - Creates a new modal dialog window + Delegate used by to populate select options. - url to open in window. - window title (may not be supported by all js implementations) - - + current object (for instance a User). + Text that should be displayed in the value part of a <optiongt;-tag. + Text shown in the select list. + + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } /// - + - Requests a url through ajax + Arguments used when more body bytes have come. - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. - a link tag - onclick attribute is used by this method. - - - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); - - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - - - + - Determins if a list of strings contains a specific value + Initializes a new instance of the class. - options to check in - value to find - true if value was found - case insensitive + buffer that contains the received bytes. + offset in buffer where to start processing. + number of bytes from that should be parsed. - + - Ajax requests that updates an element with - the fetched content + Initializes a new instance of the class. - URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself. - element to update - options in format "key, value, key, value". All keys should end with colon. - A link tag. - - - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - - - + - A link that pop ups a Dialog (overlay div) + Gets or sets buffer that contains the received bytes. + + + + + Gets or sets number of bytes from that should be parsed. + + + + + Gets or sets offset in buffer where to start processing. + + + + + Response that is sent back to the web browser / client. + + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + + The second and slighty more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set ContentType and ContentLength before doing so. - URL to contents of dialog - link title - name, value, name, value - - A "a"-tag that popups a dialog when clicked - - Requires Control.Modal found here: http://livepipe.net/projects/control_modal/ - And the following JavaScript (load it in application.js): - - Event.observe(window, 'load', - function() { - document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); - } - ); - - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + public void MyHandler(IHttpRequest request, IHttpResponse response) + { + + } - + + + Add another header to the document. + + Name of the header, case sensitive, use lower cases. + Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n + If headers already been sent. + If value conditions have not been met. + Adding any header will override the default ones and those specified by properties. + + + + Send headers and body to the browser. + + If content have already been sent. + + + + Make sure that you have specified ContentLength and sent the headers first. + + + If headers have not been sent. + + offest of first byte to send + number of bytes to send. + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Make sure that you have specified ContentLength and sent the headers first. + + + If headers have not been sent. + + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Send headers to the client. + + If headers already been sent. + + + + + - create a modal dialog (usually using DIVs) + Redirect client to somewhere else using the 302 status code. - url to fetch - dialog title - javascript/html attributes. javascript options ends with colon ':'. - + Destination of the redirect + If headers already been sent. + You can not do anything more with the request when a redirect have been done. This should be your last + action. - + - Close a javascript dialog window/div. + redirect to somewhere - javascript for closing a dialog. - + where the redirect should go + + No body are allowed when doing redirects. + - + - javascript action that should be added to the "onsubmit" event in the form tag. + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. - remember to encapsulate strings in '' - - All javascript option names should end with colon. - - - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - - - + - Lists content type mime types. + Defines the version of the HTTP Response for applications where it's required + for this to be forced. - + - text/plain + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. - + - text/haml + Kind of connection - + - content type for javascript documents = application/javascript + Encoding to use when sending stuff to the client. - - - RFC 4329 states that text/javascript have been superseeded by - application/javascript. You might still want to check browser versions - since older ones do not support application/javascript. - - Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/ - + Default is UTF8 - + - text/xml + Number of seconds to keep connection alive + Only used if Connection property is set to ConnectionType.KeepAlive - + - A list of content types + Status code that is sent to the client. + Default is HttpStatusCode.Ok - + - + Information about why a specific status code was used. - Semicolon separated content types. - + - Returns an enumerator that iterates through a collection. + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. - - An object that can be used to iterate through the collection. - - + - Searches for the specified type + Kind of content in the body - Can also be a part of a type (searching for "xml" would return true for "application/xml"). - true if type was found. + Default is text/html - + - Get this first content type. + Headers have been sent to the client- + You can not send any additional headers if they have already been sent. - + - Fetch a content type + The whole response have been sent. - Part of type ("xml" would return "application/xml") - - All content types are in lower case. - + - Event arguments used when a new header have been parsed. + Cookies that should be created/changed. - + - Initializes a new instance of the class. + Type of HTTP connection - Name of header. - Header value. - + - Initializes a new instance of the class. + Connection is closed after each request-response - + - Gets or sets header name. + Connection is kept alive for X seconds (unless another request have been made) - + - Gets or sets header value. + Contains server side HTTP request information. - + - A reverse proxy are used to act as a bridge between local (protected/hidden) websites - and public clients. - - A typical usage is to allow web servers on non standard ports to still be available - to the public clients, or allow web servers on private ips to be available. + Called during parsing of a . + Name of the header, should not be URL encoded + Value of the header, should not be URL encoded + If a header is incorrect. - + - + Add bytes to the body - Base url requested from browser - Base url on private web server - - // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas - _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); - + buffer to read bytes from + where to start read + number of bytes to read + Number of bytes actually read (same as length unless we got all body bytes). + If body is not writable + bytes is null. + offset is out of range. - + - Method that determines if an url should be handled or not by the module + Clear everything in the request - Url requested by the client. - true if module should handle the url. - + - Method that process the url + Decode body into a form. - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to + A list with form decoders. + If body contents is not valid for the chosen decoder. + If body is still being transferred. - + - Contains a connection to a browser/client. + Sets the cookies. - - Remember to after you have hooked the event. - - TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? + The cookies. - + - Contains a connection to a browser/client. + Create a response object. + Context for the connected client. + A new . - + - Disconnect from client + Gets kind of types accepted by the client. - error to report in the event. - + - Send a response. + Gets or sets body stream. - Either or - HTTP status code - reason for the status code. - HTML body contents, can be null or empty. - A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty - If is invalid. - + - Send a response. + Gets whether the body is complete. - Either or - HTTP status code - reason for the status code. - + - Send a response. + Gets or sets kind of connection used for the session. - - + - send a whole buffer + Gets or sets number of bytes in the body. - buffer to send - - + - Send data using the stream + Gets cookies that was sent with the request. - Contains data to send - Start position in buffer - number of bytes to send - - - + - Closes the streams and disposes of the unmanaged resources + Gets form parameters. - + - Using SSL or other encryption method. + Gets headers sent by the client. - + + + Gets or sets version of HTTP protocol that's used. + + + Probably or . + + + + - Using SSL or other encryption method. + Gets whether the request was made by Ajax (Asynchronous JavaScript) - + - The context have been disconnected. + Gets or sets requested method. - Event can be used to clean up a context, or to reuse it. + Will always be in upper case. + - + - A request have been received in the context. + Gets parameter from or . - + - Initializes a new instance of the class. + Gets variables sent in the query string - true if the connection is secured (SSL/TLS) - client that connected. - Stream used for communication - Used to create a . - Size of buffer to use when reading data. Must be at least 4096 bytes. - If fails - Stream must be writable and readable. - + - Process incoming body bytes. + Gets or sets requested URI. - - Bytes - + - + Gets URI absolute path divided into parts. - - + + // URI is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny + + + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. + + - + - Start reading content. + Gets or sets path and query. + - Make sure to call base.Start() if you override this method. + Are only used during request parsing. Cannot be set after "Host" header have been + added. - + - Clean up context. + Contains a connection to a browser/client. - - Make sure to call base.Cleanup() if you override the method. - - + Disconnect from client - error to report in the event. - - - BadRequestException. + error to report in the event. - + Send a response. @@ -2819,7 +2683,7 @@ A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty If is invalid. - + Send a response. @@ -2827,20 +2691,20 @@ HTTP status code reason for the status code. - + Send a response. - + send a whole buffer buffer to send - + Send data using the stream @@ -2850,635 +2714,620 @@ - - - This context have been cleaned, which means that it can be reused. - - - + - Context have been started (a new client have connected) + Closes the streams and disposes of the unmanaged resources - + - Overload to specify own type. + Using SSL or other encryption method. - - Must be specified before the context is being used. - - + Using SSL or other encryption method. - + - Using SSL or other encryption method. + The context have been disconnected. + + Event can be used to clean up a context, or to reuse it. + - + - Specify which logger to use. + A request have been received in the context. - + - Gets or sets the network stream. + A have been disconnected. - + - Gets or sets IP address that the client connected from. + Initializes a new instance of the class. + Reason to disconnection. - + - Gets or sets port that the client connected from. + Gets reason to why client disconnected. - + - The context have been disconnected. + - - Event can be used to clean up a context, or to reuse it. - - + - A request have been received in the context. + Initializes a new instance of the class. + The request. - + - Helpers to make XML handling easier + Gets received request. - + - Serializes object to XML. + The website module let's you handle multiple websites in the same server. + It uses the "Host" header to check which site you want. - object to serialize. - XML - - Removes name spaces and adds indentation - + It's recommended that you do not + add any other modules to HttpServer if you are using the website module. Instead, + add all wanted modules to each website. - + - Create an object from a XML string + - Type of object - XML string - object + domain name that should be handled. + - + - Can handle application/x-www-form-urlencoded + Method that process the url + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to - + + Name of site. - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream encoding - - A HTTP form, or null if content could not be parsed. - - If contents in the stream is not valid input data. - + - Checks if the decoder can handle the mime type + represents a HTTP input item. Each item can have multiple sub items, a sub item + is made in a HTML form by using square brackets - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type + + // becomes: + Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value); + + + All names in a form SHOULD be in lowercase. + - + + Representation of a non-initialized . + + - The server understood the request, but is refusing to fulfill it. - Authorization will not help and the request SHOULD NOT be repeated. - If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, - it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information - available to the client, the status code 404 (Not Found) can be used instead. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php + Initializes an input item setting its name/identifier and value + Parameter name/id + Parameter value - + + Creates a deep copy of the item specified + The item to copy + The function makes a deep copy of quite a lot which can be slow + + - Initializes a new instance of the class. + Add another value to this item - error message + Value to add. + Cannot add stuff to . - + - Invoked when a client have been accepted by the + checks if a sub-item exists (and has a value). - - Can be used to revoke incoming connections - + name in lower case + true if the sub-item exists and has a value; otherwise false. - + + Returns a formatted representation of the instance with the values of all contained parameters + + - Initializes a new instance of the class. + Outputs the string in a formatted manner - The socket. + A prefix to append, used internally + produce a query string - + - Client may not be handled. + Add a sub item. + Can contain array formatting, the item is then parsed and added in multiple levels + Value to add. + Argument is null. + Cannot add stuff to . - + - Accepted socket. + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 - + - Client should be revoked. + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 - - Class to handle loading of resource files - - + - Initializes a new instance of the class. + Outputs the string in a formatted manner + A prefix to append, used internally + - + - Initializes a new instance of the class. + Number of values - logger. - + - Loads resources from a namespace in the given assembly to an URI + Get a sub item - The URI to map the resources to - The assembly in which the resources reside - The namespace from which to load the resources - - - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ - - The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded - If a resource has already been mapped to an uri + name in lower case. + if no item was found. - + - Retrieves a stream for the specified resource path if loaded otherwise null + Name of item (in lower case). - Path to the resource to retrieve a stream for - A stream or null if the resource couldn't be found - + - Fetch all files from the resource that matches the specified arguments. + Returns the first value, or null if no value exist. - The path to the resource to extract - - a list of files if found; or an empty array if no files are found. - - Search path must end with an asterisk for finding arbitrary files - + - Fetch all files from the resource that matches the specified arguments. + Returns the last value, or null if no value exist. - Where the file should reside. - Files to check - - a list of files if found; or an empty array if no files are found. - - + - Returns whether or not the loader has an instance of the file requested + Returns the list with values. - The name of the template/file - True if the loader can provide the file - + + name in lower case - - - - - Represents a field in a multipart form - + - This provider is used to let us implement any type of form decoding we want without - having to rewrite anything else in the server. + Container class for posted files - + - + Creates a container for a posted file - Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959 - Stream containing form data. - Encoding used when decoding the stream - if no parser was found. - If stream is null or not readable. - If stream contents cannot be decoded properly. + The identifier of the post field + The file path + The content type of the file + The name of the file uploaded + If any parameter is null or empty - + - Add a decoder. + Creates a container for a posted file - - + If any parameter is null or empty - - - Number of added decoders. - + + Destructor disposing the file - + - Use with care. + Deletes the temporary file + True if manual dispose - + - Decoder used for unknown content types. + Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization - + - Delegate used to find a realm/domain. + The name/id of the file - - - - Realms are used during HTTP Authentication - - - - + - A complete HTTP server, you need to add a module to it to be able to handle incoming requests. + The full file path - - - // this small example will add two web site modules, thus handling - // two different sites. In reality you should add Controller modules or something - // two the website modules to be able to handle different requests. - HttpServer server = new HttpServer(); - server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); - server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); - - // start regular http - server.Start(IPAddress.Any, 80); - - // start https - server.Start(IPAddress.Any, 443, myCertificate); - - - - - - + - Initializes a new instance of the class. + The name of the uploaded file - Used to get all components used in the server.. - + - Initializes a new instance of the class. + The type of file - + - Initializes a new instance of the class. + PrototypeJS implementation of the javascript functions. - Form decoders are used to convert different types of posted data to the object types. - - - + - Initializes a new instance of the class. + Requests a url through ajax - A session store is used to save and retrieve sessions - + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. + optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. + a link tag + onclick attribute is used by this method. + + + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; + + - + - Initializes a new instance of the class. + Determins if a list of strings contains a specific value - The log writer. - + options to check in + value to find + true if value was found + case insensitive - + - Initializes a new instance of the class. + Ajax requests that updates an element with + the fetched content - Form decoders are used to convert different types of posted data to the object types. - The log writer. - - - + URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself. + element to update + options in format "key, value, key, value". All keys should end with colon. + A link tag. + + + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); + + - + - Initializes a new instance of the class. + A link that pop ups a Dialog (overlay div) - Form decoders are used to convert different types of posted data to the object types. - A session store is used to save and retrieve sessions - The log writer. - - - - + URL to contents of dialog + link title + name, value, name, value + + A "a"-tag that popups a dialog when clicked + + Requires Control.Modal found here: http://livepipe.net/projects/control_modal/ + And the following JavaScript (load it in application.js): + + Event.observe(window, 'load', + function() { + document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); + } + ); + + + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + - + - Adds the specified rule. + create a modal dialog (usually using DIVs) - The rule. + url to fetch + dialog title + javascript/html attributes. javascript options ends with colon ':'. + - + - Add a to the server. + Close a javascript dialog window/div. - mode to add + javascript for closing a dialog. + - + - Decodes the request body. + javascript action that should be added to the "onsubmit" event in the form tag. - The request. - Failed to decode form data. + remember to encapsulate strings in '' + + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + - + - Generate a HTTP error page (that will be added to the response body). - response status code is also set. + The request requires user authentication. The response MUST include a + WWW-Authenticate header field (section 14.47) containing a challenge + applicable to the requested resource. + + The client MAY repeat the request with a suitable Authorization header + field (section 14.8). If the request already included Authorization + credentials, then the 401 response indicates that authorization has been + refused for those credentials. If the 401 response contains the same challenge + as the prior response, and the user agent has already attempted authentication + at least once, then the user SHOULD be presented the entity that was given in the response, + since that entity might include relevant diagnostic information. + + HTTP access authentication is explained in rfc2617: + http://www.ietf.org/rfc/rfc2617.txt + + (description is taken from + http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) - Response that the page will be generated in. - . - response body contents. - + - Generate a HTTP error page (that will be added to the response body). - response status code is also set. + Create a new unauhtorized exception. - Response that the page will be generated in. - exception. + - + - Realms are used by the s. + Create a new unauhtorized exception. - HTTP request - domain/realm. + reason to why the request was unauthorized. + inner exception - + - Process an incoming request. + Create a new unauhtorized exception. - connection to client - request information - response that should be filled - session information + reason to why the request was unauthorized. - + - Can be overloaded to implement stuff when a client have been connected. + The server understood the request, but is refusing to fulfill it. + Authorization will not help and the request SHOULD NOT be repeated. + If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, + it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information + available to the client, the status code 404 (Not Found) can be used instead. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - - Default implementation does nothing. - - client that disconnected - disconnect reason - + - Handle authentication + Initializes a new instance of the class. - - - - true if request can be handled; false if not. - Invalid authorization header + error message - + - Will request authentication. + The "basic" authentication scheme is based on the model that the + client must authenticate itself with a user-ID and a password for + each realm. The realm value should be considered an opaque string + which can only be compared for equality with other realms on that + server. The server will service the request only if it can validate + the user-ID and password for the protection space of the Request-URI. + There are no optional authentication parameters. - - Sends respond to client, nothing else can be done with the response after this. - - - - - + - Received from a when a request have been parsed successfully. + Initializes a new instance of the class. - that received the request. - The request. + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). - + - To be able to track request count. + Initializes a new instance of the class. - - + Delegate used to provide information used during authentication. - + - Start the web server using regular HTTP. + Create a response that can be sent in the WWW-Authenticate header. - IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards. - Port to listen on. 80 can be a good idea =) - address is null. - Port must be a positive number. + Realm that the user should authenticate in + Not used in basic auth + A correct auth request. - + - Accept secure connections. + An authentication response have been received from the web browser. + Check if it's correct - IP Address to listen on, use to accept connections on all IP Addresses / network cards. - Port to listen on. 80 can be a good idea =) - Certificate to use - address is null. - Port must be a positive number. + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + Not used in basic auth + Authentication object that is stored for the request. A user class or something like that. + if authenticationHeader is invalid + If any of the paramters is empty or null. - + - shut down the server and listeners + name used in http request. - + - write an entry to the log file + A session store is used to store and load sessions on a media. + The default implementation () saves/retrieves sessions from memory. - importance of the message - log message - + - write an entry to the log file + Creates a new http session with a generated id. - object that wrote the message - importance of the message - log message + A object - + - Server that is handling the current request. + Creates a new http session with a specific id + Id used to identify the new cookie.. + A object. - Will be set as soon as a request arrives to the object. + Id should be generated by the store implementation if it's null or . - + - Modules used for authentication. The module that is is added first is used as - the default authentication module. + Load an existing session. - Use the corresponding property - in the if you are using multiple websites. + Session id (usually retrieved from a client side cookie). + A session if found; otherwise null. - + - Form decoder providers are used to decode request body (which normally contains form data). + Save an updated session to the store. + + Session id (usually retrieved from a client side cookie). + If Id property have not been specified. + + + + We use the flyweight pattern which reuses small objects + instead of creating new each time. + Unused session that should be reused next time Create is called. - + - Server name sent in HTTP responses. + Remove expired sessions - - Do NOT include version in name, since it makes it - easier for hackers. - - + - Name of cookie where session id is stored. + Remove a session + id of the session. - + - Specified where logging should go. + Load a session from the store - - - + + null if session is not found. - + - Number of connections that can wait to be accepted by the server. + Number of minutes before a session expires. - Default is 10. + Default time is 20 minutes. - + - Gets or sets maximum number of allowed simultaneous requests. + This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). + The framework might switch class in the future and we dont want to have to replace all instances - - - This property is useful in busy systems. The HTTP server - will start queuing new requests if this limit is hit, instead - of trying to process all incoming requests directly. - - - The default number if allowed simultaneous requests are 10. - - - + - Gets or sets maximum number of requests queuing to be handled. + Let's copy all the cookies. - - - The WebServer will start turning requests away if response code - to indicate that the server - is too busy to be able to handle the request. - - + value from cookie header. + + + + Adds a cookie in the collection. + + cookie to add + cookie is null - + - Realms are used during HTTP authentication. - Default realm is same as server name. + Gets a collection enumerator on the cookie list. + collection enumerator - + - Let's to receive unhandled exceptions from the threads. + Remove all cookies. - - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. - - + - + Returns an enumerator that iterates through the collection. - - http://www.faqs.org/rfcs/rfc1867.html - + + + A that can be used to iterate through the collection. + + 1 - + - multipart/form-data + Remove a cookie from the collection. + Name of cookie. - + - form-data + Gets the count of cookies in the collection. - + - + Gets the cookie of a given identifier (null if not existing). - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream enconding - A http form, or null if content could not be parsed. - If contents in the stream is not valid input data. - If any parameter is null - + - Checks if the decoder can handle the mime type + Inversion of control interface. - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type - + Add a component instance Interface type Instance to add - + Get a component. @@ -3488,555 +3337,546 @@ Component will get created if needed. - - If instance cannot be created. - - + Checks if the specified component interface have been added. true if found; otherwise false. - + Add a component. Type being requested. Type being created. - Type have already been mapped. - + - The purpose of this module is to serve files. + Contains server side HTTP request information. - + - Initializes a new instance of the class. + Chars used to split an URL path into multiple parts. - Uri to serve, for instance "/files/" - Path on hard drive where we should start looking for files - If true a Last-Modifed header will be sent upon requests urging web browser to cache files - + - Initializes a new instance of the class. + Assign a form. - Uri to serve, for instance "/files/" - Path on hard drive where we should start looking for files + - + - Mimtypes that this class can handle per default + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + 2 - + - Determines if the request should be handled by this module. - Invoked by the + Decode body into a form. - - true if this module should handle it. - - - Illegal path + A list with form decoders. + If body contents is not valid for the chosen decoder. + If body is still being transferred. - + - check if source contains any of the chars. + Cookies - - - + the cookies - + - Method that process the Uri. + Create a response object. - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - Failed to find file extension - File type is forbidden. + A new . - + - return a file extension from an absolute Uri path (or plain filename) + Called during parsing of a . - - + Name of the header, should not be URL encoded + Value of the header, should not be URL encoded + If a header is incorrect. - + - List with all mime-type that are allowed. + Add bytes to the body - All other mime types will result in a Forbidden http status code. + buffer to read bytes from + where to start read + number of bytes to read + Number of bytes actually read (same as length unless we got all body bytes). + If body is not writable + bytes is null. + offset is out of range. - + - characters that may not exist in a path. + Clear everything in the request - - fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; - - + - Contains a listener that doesn't do anything with the connections. + Gets or sets a value indicating whether this is secure. - + - Listen for regular HTTP connections + Path and query (will be merged with the host header) and put in Uri - IP Address to accept connections on - TCP Port to listen on, default HTTP port is 80. - Factory used to create es. - address is null. - Port must be a positive number. + - + - Initializes a new instance of the class. + Gets whether the body is complete. - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Factory used to create es. - Certificate to use - + - Initializes a new instance of the class. + Gets kind of types accepted by the client. - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Factory used to create es. - Certificate to use - which HTTPS protocol to use, default is TLS. - - Exception. + + + Gets or sets body stream. + - + - Will try to accept connections one more time. + Gets or sets kind of connection used for the session. - If any exceptions is thrown. - + - Can be used to create filtering of new connections. + Gets or sets number of bytes in the body. - Accepted socket - true if connection can be accepted; otherwise false. - + - Start listen for new connections + Gets headers sent by the client. - Number of connections that can stand in a queue to be accepted. - Listener have already been started. - + - Stop the listener + Gets or sets version of HTTP protocol that's used. - + + Probably or . + + - + - Gives you a change to receive log entries for all internals of the HTTP library. + Gets or sets requested method. + - You may not switch log writer after starting the listener. + Will always be in upper case. + - + - True if we should turn on trace logs. + Gets variables sent in the query string - + - Catch exceptions not handled by the listener. + Gets or sets requested URI. + + + + + Uri absolute path splitted into parts. + + // uri is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny + - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. + - + + + Gets parameter from or . + + + - A request have been received from a . + Gets form parameters. - + - Container class for posted files + Gets whether the request was made by Ajax (Asynchronous JavaScript) - + - Creates a container for a posted file + Gets cookies that was sent with the request. - The identifier of the post field - The file path - The content type of the file - The name of the file uploaded - If any parameter is null or empty - + - Creates a container for a posted file + The object form class takes an object and creates form items for it. - If any parameter is null or empty - - Destructor disposing the file + + + Initializes a new instance of the class. + + + form name *and* id. + action to do when form is posted. + - + - Deletes the temporary file + Initializes a new instance of the class. - True if manual dispose + form name *and* id. + action to do when form is posted. + object to get values from - + - Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization + Initializes a new instance of the class. + form action. + object to get values from. - + - The name/id of the file + write out the FORM-tag. + generated html code - + - The full file path + Writeout the form tag + form should be posted through ajax. + generated html code - + - The name of the uploaded file + Generates a text box. + + + generated html code - + - The type of file + password box + + + generated html code - + - Implements HTTP Digest authentication. It's more secure than Basic auth since password is - encrypted with a "key" from the server. + Hiddens the specified property name. - - Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. - + Name of the property. + The options. + generated html code - + - Initializes a new instance of the class. + Labels the specified property name. - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). + property in object. + caption + generated html code - + - Initializes a new instance of the class. + Generate a checkbox - Delegate used to provide information used during authentication. + property in object + checkbox value + additional html attributes. + generated html code - + - Used by test classes to be able to use hardcoded values + Write a html select tag + object property. + id column + The title column. + The options. + - + - An authentication response have been received from the web browser. - Check if it's correct + Selects the specified property name. - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - First option: true if username/password is correct but not cnonce - - Authentication object that is stored for the request. A user class or something like that. - - if authenticationHeader is invalid - If any of the paramters is empty or null. + Name of the property. + The items. + The id column. + The title column. + The options. + - + - Encrypts parameters into a Digest string + Write a submit tag. - Realm that the user want to log into. - User logging in - Users password. - HTTP method. - Uri/domain that generated the login prompt. - Quality of Protection. - "Number used ONCE" - Hexadecimal request counter. - "Client Number used ONCE" - Digest encrypted string + button caption + html submit tag - + - + html end form tag - Md5 hex encoded "userName:realm:password", without the quotes. - Md5 hex encoded "method:uri", without the quotes - Quality of Protection - "Number used ONCE" - Hexadecimal request counter. - Client number used once - + html - + - Create a response that can be sent in the WWW-Authenticate header. + Can handle application/x-www-form-urlencoded - Realm that the user should authenticate in - First options specifies if true if username/password is correct but not cnonce. - A correct auth request. - If realm is empty or null. - + - Decodes authorization header value - header value - Encoding that the buffer is in - All headers and their values if successful; otherwise null - - NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); - - Can handle lots of whitespaces and new lines without failing. + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream encoding + + A HTTP form, or null if content could not be parsed. + + If contents in the stream is not valid input data. - + - Gets the current nonce. + Checks if the decoder can handle the mime type - + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type - + - Gets the Md5 hash bin hex2. + - To be hashed. - + + http://www.faqs.org/rfcs/rfc1867.html + - + - determines if the nonce is valid or has expired. + multipart/form-data - nonce value (check wikipedia for info) - true if the nonce has not expired. - + - name used in http request. + form-data - + - Gets or sets whether the token supplied in is a - HA1 generated string. + + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream enconding + A http form, or null if content could not be parsed. + If contents in the stream is not valid input data. + If any parameter is null - + - Current state in the parsing. + Checks if the decoder can handle the mime type + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type - + - Should parse the request line + Invoked when a client have been accepted by the + + Can be used to revoke incoming connections + - + - Searching for a complete header name + Initializes a new instance of the class. + The socket. - + - Searching for colon after header name (ignoring white spaces) + Client may not be handled. - + - Searching for start of header value (ignoring white spaces) + Accepted socket. - + - Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) + Client should be revoked. - + - Adding bytes to body + The purpose of this module is to serve files. - + - Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules - a regular expression can be used to identify redirect URLs and their targets. + Initializes a new instance of the class. - - [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) - ]]> - + Uri to serve, for instance "/files/" + Path on hard drive where we should start looking for files + If true a Last-Modifed header will be sent upon requests urging web browser to cache files - + - Initializes a new instance of the class. + Initializes a new instance of the class. - Expression to match URL - Expression to generate URL - - [a-zA-Z0-9]+)", "/user/${first}")); - Result of ie. /employee1 will then be /user/employee1 - ]]> - + Uri to serve, for instance "/files/" + Path on hard drive where we should start looking for files - + - Initializes a new instance of the class. + Mimtypes that this class can handle per default - Expression to match URL - Expression to generate URL - Regular expression options to use, can be null - - [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - - + - Initializes a new instance of the class. + Determines if the request should be handled by this module. + Invoked by the - Expression to match URL - Expression to generate URL - Regular expression options to apply - true if request should be redirected, false if the request URI should be replaced. - - [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - - Argument is null. - + + true if this module should handle it. - + + Illegal path + + - Process the incoming request. + check if source contains any of the chars. - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - - If request or response is null + + + - + - This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). - The framework might switch class in the future and we dont want to have to replace all instances + Method that process the Uri. + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + Failed to find file extension + File type is forbidden. - + - Let's copy all the cookies. + return a file extension from an absolute Uri path (or plain filename) - value from cookie header. + + - + - Adds a cookie in the collection. + List with all mime-type that are allowed. - cookie to add - cookie is null + All other mime types will result in a Forbidden http status code. - + - Gets a collection enumerator on the cookie list. + characters that may not exist in a path. - collection enumerator + + fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; + - + - Remove all cookies. + Helpers to make XML handling easier - + - Returns an enumerator that iterates through the collection. + Serializes object to XML. - - - A that can be used to iterate through the collection. - - 1 + object to serialize. + XML + + Removes name spaces and adds indentation + - + - Remove a cookie from the collection. + Create an object from a XML string - Name of cookie. + Type of object + XML string + object - + - Gets the count of cookies in the collection. + The requested resource was not found in the web server. - + - Gets the cookie of a given identifier (null if not existing). + Create a new exception + message describing the error + inner exception - + - Arguments used when more body bytes have come. + Create a new exception + message describing the error - + - Initializes a new instance of the class. + cookie sent by the client/browser - buffer that contains the received bytes. - offset in buffer where to start processing. - number of bytes from that should be parsed. + - + - Initializes a new instance of the class. + Constructor. + cookie identifier + cookie content + id or content is null + id is empty - + - Gets or sets buffer that contains the received bytes. + Gets the cookie HTML representation. + cookie string - + - Gets or sets number of bytes from that should be parsed. + Gets the cookie identifier. - + - Gets or sets offset in buffer where to start processing. + Cookie value. Set to null to remove cookie. @@ -4093,288 +3933,262 @@ Item if found; otherwise HttpInputItem.EmptyLanguageNode - + - We dont want to let the server to die due to exceptions thrown in worker threads. - therefore we use this delegate to give you a change to handle uncaught exceptions. + Contains a connection to a browser/client. - Class that the exception was thrown in. - Exception - Server will throw a InternalServerException in release version if you dont - handle this delegate. + Remember to after you have hooked the event. + TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? - + - Delegate used to let authentication modules authenticate the user name and password. + Initializes a new instance of the class. + + true if the connection is secured (SSL/TLS) + client that connected. + Stream used for communication + Used to create a . + Size of buffer to use when reading data. Must be at least 4096 bytes. + If fails + Stream must be writable and readable. + + + + Process incoming body bytes. + + + Bytes + + + + + + + + + + + Start reading content. - Realm that the user want to authenticate in - User name specified by client - Can either be user password or implementation specific token. - object that will be stored in a session variable called if authentication was successful. - throw forbidden exception if too many attempts have been made. - - Use to specify that the token is a HA1 token. (MD5 generated - string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); - + Make sure to call base.Start() if you override this method. - + - Let's you decide on a system level if authentication is required. + Clean up context. - HTTP request from client - true if user should be authenticated. - throw if no more attempts are allowed. - If no more attempts are allowed + + Make sure to call base.Cleanup() if you override the method. + + + + + Disconnect from client + + error to report in the event. + + + BadRequestException. + + + + Send a response. + + Either or + HTTP status code + reason for the status code. + HTML body contents, can be null or empty. + A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty + If is invalid. - + - New implementation of the HTTP listener. + Send a response. - - Use the Create methods to create a default listener. - + Either or + HTTP status code + reason for the status code. - + - Initializes a new instance of the class. + Send a response. - IP Address to accept connections on - TCP Port to listen on, default HTTP port is 80. - Factory used to create es. - address is null. - Port must be a positive number. + - + - Initializes a new instance of the class. + send a whole buffer - The address. - The port. - The factory. - The certificate. + buffer to send + - + - Initializes a new instance of the class. + Send data using the stream - The address. - The port. - The factory. - The certificate. - The protocol. + Contains data to send + Start position in buffer + number of bytes to send + + - + - Creates a new instance with default factories. + This context have been cleaned, which means that it can be reused. - Address that the listener should accept connections on. - Port that listener should accept connections on. - Created HTTP listener. - + - Creates a new instance with default factories. + Context have been started (a new client have connected) - Address that the listener should accept connections on. - Port that listener should accept connections on. - Certificate to use - Created HTTP listener. - + - Creates a new instance with default factories. + Overload to specify own type. - Address that the listener should accept connections on. - Port that listener should accept connections on. - Certificate to use - which HTTPS protocol to use, default is TLS. - Created HTTP listener. + + Must be specified before the context is being used. + - + - Can be used to create filtering of new connections. + Using SSL or other encryption method. - Accepted socket - - true if connection can be accepted; otherwise false. - - + - A client have been accepted, but not handled, by the listener. + Using SSL or other encryption method. - + - Webhelper provides helpers for common tasks in HTML. + Specify which logger to use. - + - Used to let the website use different javascript libraries. - Default is + Gets or sets the network stream. - + - Creates a link that invokes through ajax. + Gets or sets IP address that the client connected from. - url to fetch - link title - - optional options in format "key, value, key, value". - Javascript options starts with ':'. - - a link tag - - WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); - - + - Builds a link that updates an element with the fetched ajax content. + Gets or sets port that the client connected from. - Url to fetch content from - link title - html element to update with the results of the ajax request. - optional options in format "key, value, key, value" - A link tag. - + - A link that pop ups a Dialog (overlay div) + The context have been disconnected. - url to contents of dialog - link title - name/value of html attributes. - A "a"-tag that popups a dialog when clicked - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - + + Event can be used to clean up a context, or to reuse it. + - + - Create/Open a dialog box using ajax + A request have been received in the context. - - - - - - - Close a javascript dialog window/div. - - javascript for closing a dialog. - + + Class to handle loading of resource files - + - Create a <form> tag. + Initializes a new instance of the class. - name of form - action to invoke on submit - form should be posted as ajax - html code - - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - - + - Create a link tag. + Initializes a new instance of the class. - url to go to - link title (text that is displayed) - html attributes, name, value, name, value - html code - - WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); - + logger. - + - Build a link + Loads resources from a namespace in the given assembly to an URI - url to go to. - title of link (displayed text) - extra html attributes. - a complete link + The URI to map the resources to + The assembly in which the resources reside + The namespace from which to load the resources + + + resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); + + Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ + + The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded + If a resource has already been mapped to an uri - + - Build a link + Retrieves a stream for the specified resource path if loaded otherwise null - url to go to. - title of link (displayed text) - extra html attributes. - a complete link - more options + Path to the resource to retrieve a stream for + A stream or null if the resource couldn't be found - + - Obsolete + Fetch all files from the resource that matches the specified arguments. - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete + The path to the resource to extract + + a list of files if found; or an empty array if no files are found. + + Search path must end with an asterisk for finding arbitrary files - + - Obsolete + Fetch all files from the resource that matches the specified arguments. - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete + Where the file should reside. + Files to check + + a list of files if found; or an empty array if no files are found. + - + - Render errors into a UL with class "errors" + Returns whether or not the loader has an instance of the file requested - class used by UL-tag. - items to list - an unordered html list. + The name of the template/file + True if the loader can provide the file - + - Render errors into a UL with class "errors" + Small design by contract implementation. - class used by UL-tag. - items to list - an unordered html list. - + - Render errors into a UL with class "errors" + Check whether a parameter is empty. - - + Parameter value + Parameter name, or error description. + value is empty. - + - Generates a list with html attributes. + Checks whether a parameter is null. - StringBuilder that the options should be added to. - attributes set by user. - attributes set by any of the helper classes. + Parameter value + Parameter name, or error description. + value is null. - + - Generates a list with html attributes. + Checks whether a parameter is null. - StringBuilder that the options should be added to. - + + Parameter value + Parameter name, or error description. + value is null. @@ -4426,1031 +4240,1217 @@ Cookie is only valid under this path. - + - Contains server side HTTP request information. + Used when the request line have been successfully parsed. - + - Called during parsing of a . + Initializes a new instance of the class. - Name of the header, should not be URL encoded - Value of the header, should not be URL encoded - If a header is incorrect. + The HTTP method. + The URI path. + The HTTP version. - + - Add bytes to the body + Initializes a new instance of the class. - buffer to read bytes from - where to start read - number of bytes to read - Number of bytes actually read (same as length unless we got all body bytes). - If body is not writable - bytes is null. - offset is out of range. - + - Clear everything in the request + Gets or sets http method. + + Should be one of the methods declared in . + - + - Decode body into a form. + Gets or sets the version of the HTTP protocol that the client want to use. - A list with form decoders. - If body contents is not valid for the chosen decoder. - If body is still being transferred. - + - Sets the cookies. + Gets or sets requested URI path. - The cookies. - + - Create a response object. + Delegate used to find a realm/domain. - Context for the connected client. - A new . + + + + Realms are used during HTTP Authentication + + + - + - Gets kind of types accepted by the client. + A complete HTTP server, you need to add a module to it to be able to handle incoming requests. + + + // this small example will add two web site modules, thus handling + // two different sites. In reality you should add Controller modules or something + // two the website modules to be able to handle different requests. + HttpServer server = new HttpServer(); + server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); + server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); + + // start regular http + server.Start(IPAddress.Any, 80); + + // start https + server.Start(IPAddress.Any, 443, myCertificate); + + + + + - + - Gets or sets body stream. + Initializes a new instance of the class. + Used to get all components used in the server.. - + - Gets whether the body is complete. + Initializes a new instance of the class. - + - Gets or sets kind of connection used for the session. + Initializes a new instance of the class. + Form decoders are used to convert different types of posted data to the object types. + + - + - Gets or sets number of bytes in the body. + Initializes a new instance of the class. + A session store is used to save and retrieve sessions + - + - Gets cookies that was sent with the request. + Initializes a new instance of the class. + The log writer. + - + - Gets form parameters. + Initializes a new instance of the class. + Form decoders are used to convert different types of posted data to the object types. + The log writer. + + + - + - Gets headers sent by the client. + Initializes a new instance of the class. + + Form decoders are used to convert different types of posted data to the object types. + A session store is used to save and retrieve sessions + The log writer. + + + + + + + + Adds the specified rule. + The rule. - + - Gets or sets version of HTTP protocol that's used. + Add a to the server. + + mode to add + + + + Decodes the request body. + + The request. + Failed to decode form data. + + + + Generate a HTTP error page (that will be added to the response body). + response status code is also set. + + Response that the page will be generated in. + . + response body contents. + + + + Generate a HTTP error page (that will be added to the response body). + response status code is also set. + + Response that the page will be generated in. + exception. + + + + Realms are used by the s. + + HTTP request + domain/realm. + + + + Process an incoming request. + + connection to client + request information + response that should be filled + session information + + + + Can be overloaded to implement stuff when a client have been connected. + + + Default implementation does nothing. + + client that disconnected + disconnect reason + + + + Handle authentication + + + + + true if request can be handled; false if not. + Invalid authorization header + + + + Will request authentication. + + + Sends respond to client, nothing else can be done with the response after this. + + + + + + + + Received from a when a request have been parsed successfully. + + that received the request. + The request. + + + + To be able to track request count. + + + + + + + Start the web server using regular HTTP. + + IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards. + Port to listen on. 80 can be a good idea =) + address is null. + Port must be a positive number. + + + + Accept secure connections. - - Probably or . - - + IP Address to listen on, use to accept connections on all IP Addresses / network cards. + Port to listen on. 80 can be a good idea =) + Certificate to use + address is null. + Port must be a positive number. - + - Gets whether the request was made by Ajax (Asynchronous JavaScript) + shut down the server and listeners - + - Gets or sets requested method. + write an entry to the log file - - Will always be in upper case. - - + importance of the message + log message - + - Gets parameter from or . + write an entry to the log file + object that wrote the message + importance of the message + log message - + - Gets variables sent in the query string + Server that is handling the current request. + + Will be set as soon as a request arrives to the object. + - + - Gets or sets requested URI. + Modules used for authentication. The module that is is added first is used as + the default authentication module. + Use the corresponding property + in the if you are using multiple websites. - + - Gets URI absolute path divided into parts. + Form decoder providers are used to decode request body (which normally contains form data). - - // URI is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - - - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - - - + - Gets or sets path and query. + Server name sent in HTTP responses. - - Are only used during request parsing. Cannot be set after "Host" header have been - added. + Do NOT include version in name, since it makes it + easier for hackers. - + - Delegate used by to populate select options. + Name of cookie where session id is stored. - current object (for instance a User). - Text that should be displayed in the value part of a <optiongt;-tag. - Text shown in the select list. - - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } /// - + - The request requires user authentication. The response MUST include a - WWW-Authenticate header field (section 14.47) containing a challenge - applicable to the requested resource. - - The client MAY repeat the request with a suitable Authorization header - field (section 14.8). If the request already included Authorization - credentials, then the 401 response indicates that authorization has been - refused for those credentials. If the 401 response contains the same challenge - as the prior response, and the user agent has already attempted authentication - at least once, then the user SHOULD be presented the entity that was given in the response, - since that entity might include relevant diagnostic information. - - HTTP access authentication is explained in rfc2617: - http://www.ietf.org/rfc/rfc2617.txt - - (description is taken from - http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) + Specified where logging should go. + + + - + - Create a new unauhtorized exception. + Number of connections that can wait to be accepted by the server. - + Default is 10. - + - Create a new unauhtorized exception. + Gets or sets maximum number of allowed simultaneous requests. - reason to why the request was unauthorized. - inner exception + + + This property is useful in busy systems. The HTTP server + will start queuing new requests if this limit is hit, instead + of trying to process all incoming requests directly. + + + The default number if allowed simultaneous requests are 10. + + - + - Create a new unauhtorized exception. + Gets or sets maximum number of requests queuing to be handled. - reason to why the request was unauthorized. + + + The WebServer will start turning requests away if response code + to indicate that the server + is too busy to be able to handle the request. + + - + - The requested resource was not found in the web server. + Realms are used during HTTP authentication. + Default realm is same as server name. - + - Create a new exception + Let's to receive unhandled exceptions from the threads. - message describing the error - inner exception + + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + - + - Create a new exception + Serves files that are stored in embedded resources. - message describing the error - + - Type of HTTP connection + Initializes a new instance of the class. + Runs to make sure the basic mime types are available, they can be cleared later + through the use of if desired. - + - Connection is closed after each request-response + Initializes a new instance of the class. + Runs to make sure the basic mime types are available, they can be cleared later + through the use of if desired. + The log writer to use when logging events - + - Connection is kept alive for X seconds (unless another request have been made) + Mimtypes that this class can handle per default - + - A have been disconnected. + Loads resources from a namespace in the given assembly to an uri + The uri to map the resources to + The assembly in which the resources reside + The namespace from which to load the resources + + resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); + + will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css + + The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded - + - Initializes a new instance of the class. + Returns true if the module can handle the request - Reason to disconnection. - + - Gets reason to why client disconnected. + Method that process the url + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + true if this module handled the request. - + - + List with all mime-type that are allowed. + All other mime types will result in a Forbidden http status code. - + - Initializes a new instance of the class. + Container to bind resource names to assemblies - The request. - + - Gets received request. + Instantiates an instance of + The dot seperated uri the resource maps to + The full resource name + The assembly the resource exists in - + - Contains server side HTTP request information. + Retrieves a stream to the resource + Null if the resource couldn't be located somehow - + - Chars used to split an URL path into multiple parts. + Retrieves the assembly the resource resides in - + - Assign a form. + Retrieves the full name/path of the assembly - - + - Creates a new object that is a copy of the current instance. + Retrieves the extension of the resource - - - A new object that is a copy of this instance. - - 2 - + + Returns the Uri without extension + + + Retrieves the full path name to the resource file + + - Decode body into a form. + Helpers making it easier to work with forms. - A list with form decoders. - If body contents is not valid for the chosen decoder. - If body is still being transferred. + - + - Cookies + Used to let the website use different JavaScript libraries. + Default is - the cookies - + - Create a response object. + Create a <form> tag. - A new . + name of form + action to invoke on submit + form should be posted as Ajax + HTML code + + + // without options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + + // with options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); + + + HTML attributes or JavaScript options. + Method will ALWAYS be POST. + options must consist of name, value, name, value - + - Called during parsing of a . + Creates a select list with the values in a collection. - Name of the header, should not be URL encoded - Value of the header, should not be URL encoded - If a header is incorrect. + Name of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + string containing a SELECT-tag. + - + - Add bytes to the body + Creates a select list with the values in a collection. - buffer to read bytes from - where to start read - number of bytes to read - Number of bytes actually read (same as length unless we got all body bytes). - If body is not writable - bytes is null. - offset is out of range. + Name of the SELECT-tag + Id of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + string containing a SELECT-tag. + + + + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } + + + name, id, collection or getIdTitle is null. - + - Clear everything in the request + Creates a select list with the values in a collection. + Name of the SELECT-tag + Id of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + name, value collection of extra HTML attributes. + string containing a SELECT-tag. + + name, id, collection or getIdTitle is null. + Invalid HTML attribute list. - + - Gets or sets a value indicating whether this is secure. + Generate a list of HTML options + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + + collection or getIdTitle is null. - + + sb is null. + + - Path and query (will be merged with the host header) and put in Uri + Creates a check box. - + element name + element value + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button - + - Gets whether the body is complete. + Creates a check box. + element name + element id + element value + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + + value in your business object. (check box will be selected if it matches the element value) + - + - Gets kind of types accepted by the client. + Creates a check box. + element name + element id + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + will set value to "1". - + - Gets or sets body stream. + Creates a RadioButton. + element name + element value + determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button - + - Gets or sets kind of connection used for the session. + Creates a RadioButton. + element name + element id + element value + determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button - + - Gets or sets number of bytes in the body. + form close tag + - + - Gets headers sent by the client. + Add a component instance + Interface type + Instance to add - + - Gets or sets version of HTTP protocol that's used. + Get a component. + Interface type + Component if registered, otherwise null. - Probably or . + Component will get created if needed. - - + + If instance cannot be created. + + - Gets or sets requested method. + Checks if the specified component interface have been added. - - - Will always be in upper case. - - + + true if found; otherwise false. - + - Gets variables sent in the query string + Add a component. + Type being requested. + Type being created. + Type have already been mapped. - + - Gets or sets requested URI. + Session store using memory for each session. - + - Uri absolute path splitted into parts. + Initializes the class setting the expirationtimer to clean the session every minute - - // uri is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - - - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - - - + - Gets parameter from or . + Delegate for the cleanup timer - + - Gets form parameters. + Creates a new http session + - + - Gets whether the request was made by Ajax (Asynchronous JavaScript) + Creates a new http session with a specific id + Id used to identify the new cookie.. + A object. + + Id should be generated by the store implementation if it's null or . + - + - Gets cookies that was sent with the request. + Load an existing session. + + - + - represents a HTTP input item. Each item can have multiple sub items, a sub item - is made in a HTML form by using square brackets + Save an updated session to the store. - - // becomes: - Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value); - - - All names in a form SHOULD be in lowercase. - - - - Representation of a non-initialized . + - + - Initializes an input item setting its name/identifier and value + We use the flyweight pattern which reuses small objects + instead of creating new each time. - Parameter name/id - Parameter value + EmptyLanguageNode (unused) session that should be reused next time Create is called. - - Creates a deep copy of the item specified - The item to copy - The function makes a deep copy of quite a lot which can be slow + + + Remove expired sessions + - + - Add another value to this item + Remove a session - Value to add. - Cannot add stuff to . + id of the session. - + - checks if a sub-item exists (and has a value). + Load a session from the store - name in lower case - true if the sub-item exists and has a value; otherwise false. + + null if session is not found. - - Returns a formatted representation of the instance with the values of all contained parameters + + + Number of minutes before a session expires. + Default is 20 minutes. + - + - Outputs the string in a formatted manner + Used to queue incoming requests. - A prefix to append, used internally - produce a query string - + - Add a sub item. + Initializes a new instance of the class. - Can contain array formatting, the item is then parsed and added in multiple levels - Value to add. - Argument is null. - Cannot add stuff to . + Called when a request should be processed. - + - Returns an enumerator that iterates through the collection. + Used to process queued requests. - - - A that can be used to iterate through the collection. - - 1 - + - Returns an enumerator that iterates through a collection. + Gets or sets maximum number of allowed simultaneous requests. - - - An object that can be used to iterate through the collection. - - 2 - + - Outputs the string in a formatted manner + Gets or sets maximum number of requests queuing to be handled. - A prefix to append, used internally - - + - Number of values + Specifies how many requests the HTTP server is currently processing. - + - Get a sub item + Used two queue incoming requests to avoid + thread starvation. - name in lower case. - if no item was found. - + - Name of item (in lower case). + Method used to process a queued request + Context that the request was received from. + Request to process. - + - Returns the first value, or null if no value exist. + Response that is sent back to the web browser / client. + + + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + + The second and slightly more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set and before doing so. + + + + + // Example using response body. + class MyModule : HttpModule + { + public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) + { + StreamWriter writer = new StreamWriter(response.Body); + writer.WriteLine("Hello dear World!"); + writer.Flush(); + + // return true to tell webserver that we've handled the url + return true; + } + } + + + todo: add two examples, using SendHeaders/SendBody and just the Body stream. - + - Returns the last value, or null if no value exist. + Initializes a new instance of the class. + Client that send the . + Contains information of what the client want to receive. + cannot be empty. - + - Returns the list with values. + Initializes a new instance of the class. + Client that send the . + Version of HTTP protocol that the client uses. + Type of HTTP connection used. - + - + Add another header to the document. - name in lower case - + Name of the header, case sensitive, use lower cases. + Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n + If headers already been sent. + If value conditions have not been met. + Adding any header will override the default ones and those specified by properties. - + - Generic helper functions for HTTP + Send headers and body to the browser. + If content have already been sent. - + - Version string for HTTP v1.0 + Make sure that you have specified and sent the headers first. + + If headers have not been sent. + + offset of first byte to send + number of bytes to send. + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. - + - Version string for HTTP v1.1 + Make sure that you have specified and sent the headers first. + + If headers have not been sent. + + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. - + - An empty URI + Send headers to the client. + If headers already been sent. + + + - + - Parses a query string. + Redirect client to somewhere else using the 302 status code. - Query string (URI encoded) - A object if successful; otherwise - queryString is null. - If string cannot be parsed. + Destination of the redirect + If headers already been sent. + You can not do anything more with the request when a redirect have been done. This should be your last + action. - + - Used when the request line have been successfully parsed. + redirect to somewhere + where the redirect should go + + No body are allowed when doing redirects. + - + - Initializes a new instance of the class. + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. - The HTTP method. - The URI path. - The HTTP version. - + - Initializes a new instance of the class. + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. - + - Gets or sets http method. + Defines the version of the HTTP Response for applications where it's required + for this to be forced. - - Should be one of the methods declared in . - - + - Gets or sets the version of the HTTP protocol that the client want to use. + Kind of connection - + - Gets or sets requested URI path. + Encoding to use when sending stuff to the client. + Default is UTF8 - + - Contains all HTTP Methods (according to the HTTP 1.1 specification) - - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - + Number of seconds to keep connection alive + Only used if Connection property is set to . - + - The DELETE method requests that the origin server delete the resource identified by the Request-URI. + Status code that is sent to the client. - - - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - - - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - - - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - - - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - - + Default is - + - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + Information about why a specific status code was used. - - - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - - - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - - - + - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. - - The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining meta information about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - - + - The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + Kind of content in the body - - This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. - + Default type is "text/html" - + - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + Headers have been sent to the client- - - POST is designed to allow a uniform method to cover the following functions: - - - Annotation of existing resources; - - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - - Providing a block of data, such as the result of submitting a form, to a data-handling process; - - Extending a database through an append operation. - - - - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - - - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - - + You can not send any additional headers if they have already been sent. - + - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + The whole response have been sent. - - - - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - - - - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - - - + - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. + Cookies that should be created/changed. - + - Contains all HTTP Methods (according to the HTTP 1.1 specification) - - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - + Used to create and reuse contexts. - + - The DELETE method requests that the origin server delete the resource identified by the Request-URI. + Used to create es. - - - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - - - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - - - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - - - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - - - + + + Creates a that handles a connected client. + + Client socket (accepted by the ). + A creates . + + - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + Create a secure . - - - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - - - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - - + Client socket (accepted by the ). + HTTPS certificate to use. + Kind of HTTPS protocol. Usually TLS or SSL. + A created . - + - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + A request have been received from one of the contexts. - - The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining meta information about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - - + - The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + Initializes a new instance of the class. - - This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. - + The writer. + Amount of bytes to read from the incoming socket stream. + Used to create a request parser. - + - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + Create a new context. - - POST is designed to allow a uniform method to cover the following functions: - - - Annotation of existing resources; - - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - - Providing a block of data, such as the result of submitting a form, to a data-handling process; - - Extending a database through an append operation. - - - - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - - - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - - + true if socket is running HTTPS. + Client that connected + Network/SSL stream. + A context. - + - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + Create a new context. - - - - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - - - - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - - + true if HTTPS is used. + Remote client + Network stream, uses . + A new context (always). - + - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. + Create a secure . + Client socket (accepted by the ). + HTTPS certificate to use. + Kind of HTTPS protocol. Usually TLS or SSL. + + A created . + - + - Serves files that are stored in embedded resources. + Creates a that handles a connected client. + Client socket (accepted by the ). + + A creates . + - + - Initializes a new instance of the class. - Runs to make sure the basic mime types are available, they can be cleared later - through the use of if desired. + True if detailed trace logs should be written. - + - Initializes a new instance of the class. - Runs to make sure the basic mime types are available, they can be cleared later - through the use of if desired. + A request have been received from one of the contexts. - The log writer to use when logging events - + - Mimtypes that this class can handle per default + Custom network stream to mark sockets as reusable when disposing the stream. - + - Loads resources from a namespace in the given assembly to an uri + Creates a new instance of the class for the specified . - The uri to map the resources to - The assembly in which the resources reside - The namespace from which to load the resources - - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css - - The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded + + The that the will use to send and receive data. + + + The parameter is null. + + + The parameter is not connected. + -or- + The property of the parameter is not . + -or- + The parameter is in a nonblocking state. + - + - Returns true if the module can handle the request + Initializes a new instance of the class for the specified with the specified ownership. + + + The that the will use to send and receive data. + + + Set to true to indicate that the will take ownership of the ; otherwise, false. + + + The parameter is null. + + + The parameter is not connected. + -or- + the value of the property of the parameter is not . + -or- + the parameter is in a nonblocking state. + + + + + Creates a new instance of the class for the specified with the specified access rights. + + The that the will use to send and receive data. + + + A bitwise combination of the values that specify the type of access given to the over the provided . + + + The parameter is null. + + + The parameter is not connected. + -or- + the property of the parameter is not . + -or- + the parameter is in a nonblocking state. + - + - Method that process the url + Creates a new instance of the class for the specified with the specified access rights and the specified ownership. - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - true if this module handled the request. + + The that the will use to send and receive data. + + + A bitwise combination of the values that specifies the type of access given to the over the provided . + + + Set to true to indicate that the will take ownership of the ; otherwise, false. + + + The parameter is null. + + + The parameter is not connected. + -or- + The property of the parameter is not . + -or- + The parameter is in a nonblocking state. + - + - List with all mime-type that are allowed. + Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. - All other mime types will result in a Forbidden http status code. + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. -- cgit v1.1