!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~8)The host where the resource can be found The transport layer to be used DThis is a relative URL. It just copies (and renames) the last three  members of URL. However, it',s good to keep these two different types of ! URL apart in the type system.  does not include leading   A web URL defaults based on the scheme does not include leading  doesn' t include '#'  Parse a URL JParse just an arguments map. Can be useful for POST requests. Warning: it M occurs to be that the arguments in a POST request might include unescaped  '#'H symbols. In a URL that would be illegal, but the parser may need to be  reworked for that. Parse a relative URL "Extract a relative URL from a URL !Convert a URL to a ByteString. It's the same as show, except for the  type of the return. BSerialise just an arguments map. Can be useful for POST requests. 6The list of unsafe charactors in a URL, from RFC 1738 Bytes which aren't unsafe, are safe. 2These are the charactors which are safe in a path Parse a single key, value pair -Parse a set of URL encoded key, value pairs. IReplace any % escaped bytes in the given string with their Word8 values. HReplace pluses in the given string with spaces and then perform percent  decoding. 4Percent encode any unsafe bytes in the given string       h4The list of valid methods, see RFC 2616 section 5.1  !"#$%&'A HTTP Cookie. See  (http://en.wikipedia.org/wiki/HTTP_cookie ()*+,-./&HTTP headers, see RFC 2616 section 14 0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ A HTTP range \the final n bytes ](the bytes in the given range, inclusive ^'everything from the given byte onwards _ A HTTP reply `abcdefA HTTP request ghijklm>A mapping from status code to message. Taken from Johan Tibell's Hydra  package n0Convert a status code to a message (e.g. 200 -> OK) RFC 2616 2.1, #rule Parse an RFC1123 date !Parse a zero, or positive, int64 3Check that a list of ranges are syntatically valid pqrstX !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstXfghijkl_`abcde[^]\/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ'()*+,-.mon&%$#"! stpqrW&%$#"!  !"#$%&'()*+,-.()*+,-./+0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[^]\\]^_`abcde`abcdefghijklghijklmnpqrstIParse the given filename as a mime.types file and return a map from file  extension to mime type. Same as parseMimeTypes1, but never throw an exception, return a Nothing  instead. uv some data w end of data xerror - please don't read this source again yFA source is a stream of data, like a lazy data structure, but without < some of the dangers that such entail. A source returns a u  each time you evaluate it. z%Construct a source from a ByteString {!Construct a source from a Handle #the first and last byte to include the handle to read from |A source with no data (e.g. devnull) }$A source which reads from the given  Connection until the connection  signals end-of-file. ~A source which reads from a  the number of bytes to read *a string which is prepended to the output the connection to read from 2A source which reads an HTTP chunked reply from a  Read a source until it returns w &Convert a source to a lazy ByteString CTake, at most, the first n bytes from a Source and return a strict H ByteString. Returns Nothing on error. (A short read is not an error) GStream a source to a connection while not enqueuing more than lowWater ; bytes in the outbound queue (not inc the kernel buffer) BStream a source to a connection, with chunked encoding, while not I enqueuing more than lowWater bytes in the outbound queue (not inc the  kernel buffer) +Run an incremental parser from the network the connection to read from the block size to use !maximum number of bytes to parse  the parser !Run an incremental parser from a y the source to read from %the maximum number of bytes to parse  the parser EConvert an SSL connection to a BaseConnection for Network.Connection uvwxyz{|}~yuxwvz{|~}uxwvvwxyz{|}~BA lower level HTTP client, but it allows you to perform POSTs etc the connection to use a request to serialise #a possible payload (for POSTs etc) DConstruct a connection to the correct host for the given URL. (i.e. J resolve the hostname and create a TCP connection to the correct port). +Note that the DNS resolution (if any) doesn't block the whole process. HSetup the transport (i.e. SSL) for the given URL. In the case of a HTTP 7 scheme, this just wraps the socket in a Connection. Fetch an HTTP(S) entity. 4the headers to use. This function will set the Host 1 header for you in the case that the URL has a $ hostname in it. If in doubt, use m the resource to fetch :the connection (which you have to close once you are done  reading the y$, if any), the Reply and a possible  payload !&There are two types of checkid calls. The type of a key. DThe type of an OpenID handle. Handles are used to identify sessions  between the consumer and OP. KThis is the result of Discovery: the OP local identity and the server HTTP  endpoint. +This is the number of bytes of HTML that we'll try and read in order to ! find the OpenID link elements BUse HTML discovery to find the OpenID information for a given URL The default DH generator %The default DH prime. See appendix B CEncode a URL of URL query key-value pairs into a query string (not  including the leading ?). The string openid. is prepended to all the  key names. See 4.1.2 FEncode a list of key-value pairs, in order, into the OpenID Key Value  format. See 4.1.1. @A map of the default parameters included in all OpenID requests 2Convert an Integer to base64(btwoc) form. See 4.2 :Convert a ByteString in btwoc form to an Integer. See 4.2 GThis is the cache of association handles. It maps a string (hostname + 9 path of the OP) to a handle, key, expiry time triple. ILookup a key given the hostname of the OP and the handle. Generally used > after an indirect request to check a signature from an OP. GPerform an association with a discovered OP and return either an error J message or a handle, a key and the number of seconds from now when the  handle will expire.  Internally this uses a cache so  may not actually involve an  HTTP request to the OP. Convert a URL to a Host header An implementation of " which does an actual HTTP lookup ! everytime. This is wrapped by !, which handles caching of these ; values. You can call this directly to bypass the cache. 'Handle a reply from an associate call. reply from the server "the x value from associateRequest !(handle, key, seconds to expiry) JThis creates an associate request and returns the URL query and the value  of x IA helper function which extracts a number of keys from a list, calling a K continuation with those values if all are found and returning a Left if  any are missing the map of values the required keys the continuation  the result byte which breaks  (e.g. n) byte which breaks pairs (e.g. :) Construct a checkid call  claimed id  OP-local id  assoc handle return to URL  trust realm URL the arguments )The processing monad LProcessing a request involves running a number of actions in a StateT monad G where the state for that monad is this record. This contains both a  Source and a Handle+ element. Often something will fill in the Handle 2 and expect later processing to convert it to a Source. Somehow, you have  to end up with a Source , however. the original request  the client' s payload 2the system mime types db, mapping file extensions the current reply the current source the current handle 3an action to be performed before sending the reply Return the request Return the current reply Return the client's request payload (if any) $Get the arguments to a POST request max number of bytes to read #Get the arguments to a GET request DSet the current reply to be a reply with the given status code, the K default message for that status code, an empty body and an empty set of  headers. LSet a header in the current reply. Because of the way records work, you use  this function like this: 5 setHeader $ \h -> h { httpSomeHeader = Just value } LThis handles the If-*Matches and If-*Modified conditional headers. It takes J its information from the Last-Modified and ETag headers of the current H reply. Note that, for the purposes of ETag matching, a reply without H an ETag header is considered not to exist from the point of view of,  say, If-Matches: *. DIf the current state includes a Handle, this turns it into a Source FGiven the length of the resource, filter any unsatisfiable ranges and ' convert them all into RangeOf form. IThis handles Range requests and also translates from Handles to Sources. M If the WebMonad has a Handle at this point, then we can construct sources I from any subrange of the file. (We also assume that Content-Length is  correctly set.) See RFC 2616, section 14.35 BAt the moment, this just adds the header Server: Network.MiniHTTP KIf a source is missing, install a null source. If this was a HEAD request, = remove the current source and set the content length to 0 IThis is a very simple handler which deals with requests by returning the N requested file from the filesystem. It sets a Handle in the state and sets > the Content-Type, Content-Length and Last-Modified headers )the root of the filesystem to serve from $Read a single request from a socket &Loop, reading and processing requests    GThis is an, optional, helper function which you might find useful. The " serving fuctions both expect a WebMonad action which is called to N process each request. In general you have to write that and dispatch based  on the client' s request. IThis might save you some work: it tries each of the elements in the list K in turn. As soon as one matches it runs the given action to process the  request. the list of URL prefixes (with !) and their actions    port number  accept loop Start an IPv4 HTTP server the port number to listen on the processing action EStart an IPv4 HTTPS server. Plese remember to have wrapped your main  function in OpenSSL.withOpenSSL otherwise you'll probably crash the  process. the port number to listen on !path to public key (certificate) path to private key the processing action ASet the secret key used to HMAC and encrypt the session cookies. ,Return the current session. If the user didn't present a cookie, or the 0 cookie is invalid, an empty map is returned. ISet the current session. This alters the headers of the current request, 3 so future actions which reset the headers (like  ) will undo  this. $Add a key value pair to the session JThis puts a generic Integral type, but first it casts to a Word32 because ; it makes a different when it comes to negative numbers. JThis puts a generic Integral type, but first it casts to a Word32 because / it makes a difference with negative numbers       !"#$%&'()*+,-../01234556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcddefghijjklmnopqrstuvwxyz{|}~     network-minihttp-0.2Network.MiniHTTP.URLNetwork.MiniHTTP.MarshalNetwork.MiniHTTP.HTTPConnectionNetwork.MiniHTTP.ClientNetwork.MiniHTTP.OpenIDNetwork.MiniHTTP.ServerNetwork.MiniHTTP.SessionNetwork.MiniHTTP.MimeTypesParseHostHostname IPv6Literal IPv4LiteralSchemeHTTPSHTTP RelativeURLrurlPath rurlArguments rurlFragmentURL urlSchemeurlUser urlPasswordurlHosturlPorturlPath urlArguments urlFragmentparseparseArguments parseRelative toRelative serialiseserialiseRelativeserialiseArguments MediaTypeMethodCONNECTTRACEDELETEPUTPOSTHEADGETOPTIONSCookie cookieName cookieValue cookiePath cookieDomain cookieExpires cookieSecureHeaders httpAccepthttpAcceptCharsethttpAcceptEncodinghttpAcceptLanguagehttpAcceptRangeshttpAge httpAllowhttpAuthorization httpCookiehttpConnectionClosehttpConnectionhttpContentEncodingshttpContentLanguagehttpContentLengthhttpContentLocationhttpContentRangehttpContentTypehttpDatehttpETag httpExpireshttpHost httpIfMatchhttpIfModifiedSincehttpIfNoneMatch httpIfRangehttpIfUnmodifiedSince httpKeepAlivehttpLastModified httpLocation httpPragmahttpProxyAuthenticatehttpProxyAuthorization httpRange httpRefererhttpRetryAfter httpServer httpSetCookie httpTrailerhttpTransferEncoding httpUserAgenthttpWWWAuthenticatehttpOtherHeadersRange RangeSuffixRangeOf RangeFromReply replyMajor replyMinor replyStatus replyMessage replyHeadersRequest reqMethodreqUrlreqMajorreqMinor reqHeaders emptyHeadersstatusToMessage emptyCookie parseRequest parseReplyparseChunkHeader putRequestputReply SourceResult SourceData SourceEOF SourceErrorSourcebsSourcehSource nullSource connEOFSource connSourceconnChunkedSource sourceDrain sourceToLBS sourceToBS streamSourcestreamSourceChunkedreadIGsourceIG maybeReadsslToBaseConnectionrequest connection transport fetchBasic CheckIDTypeCheckIDImmediate CheckIDSetupKeyHandleOpenIDDiscoverydiscoveryProviderdiscoveryLocalIDdiscoverfindKey associatecheckIDprocessCheckIDReply DispatchMatchPrefixExactWebMonadWebState wsRequestwsBody wsMimeTypeswsReplywsSourcewsHandlewsAction getRequestgetReply getPayloadgetPOSTgetGETsetReply setHeader setCookiehandleConditionalRequesthandleHandleToSourcehandleRangeRequestshandleDecorationhandleFromFilesystem errorPage dispatchOnURL serveHTTP serveHTTPSsetSessionSecretKey getSession putSession addSessionhtonl inet_ntopbaseGHC.Real/wrapGet serialiseIPv4 serialiseIPv6 defaultPortdoPutputURLputRelativeURL putArgumentsdigitshexChars isHexChar unsafeChars safeChars pathSafeCharsparseKVparseKVs parseIPv6toStringparseRelativeURLparseURL toHexNibble toHexBytedecodePercents decodeString encodeString reasonPhrasesdateint64hexInt64 checkRanges parseMethodputQualityList putHeaderM putHeaderML putHeaderMLE putHeaderLputHeaderMulti whenMaybe putCookieputList putQuoted putHeadersparseMimeTypesparseMimeTypesTotalnetwork-connection-0.1.1Network.Connection Connection readReplyglobalOpenSSLClientContextdiscoveryHTMLLimitdhGdhP postEncodekeyValueEncode defaultParamsintegerToBase64btwocbtwocToIntegerassociateCache updateTVar urlToHost associateHTTPprocessAssociateReplyassociateRequest mapWrapper parseKeyValue Data.Listlines typeToStringsatisfiableRanges handleFinalpipeline readRequest readRequests sslHandshake acceptLoopacceptLoopHTTPS dispatchMatchglobalMimeTypesserve secretKeysha256aes128parseMapputMapdecodeencodevarInt32 varIntWord32 putVarInt32 putVarWord32