܌      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None T3A mask is sequence of 4 bytes. We store this in a % in the host's native byte ordering. Parse a mask. Encode a maskCreate a random maskMask a lazy bytestring. Uses  under the hood.Safe!" None08Error in case of failed handshake. Will be thrown as an .jTODO: This should probably be in the Handshake module, and is solely here to prevent a cyclic dependency.XWe don't have a match for the protocol requested by the client. todo: version parameterJThe request was somehow invalid (missing headers or wrong security token) SThe servers response was somehow invalid (missing headers or wrong security token) UThe request was well-formed, but the library user rejected it. (e.g. "unknown path") rfor example "EOF came too early" (which is actually a parse error) or for your own errors. (like "unknown path"?) A response including a bodyHTTP response, without body.A request with a body2An HTTP request. The request body is not yet read.Request headersParse an initial requestEncode an HTTP upgrade responseAn upgrade response Bad requestHTTP response parserGet the Sec-WebSocket-Version headerList of subprotocols specified by the client, in order of preference. If the client did not specify a list of subprotocols, this will be the empty list.Get the Sec-WebSocket-Extensions header% #   None0JVarious exceptions that can occur while receiving or transmitting messages The peer has requested that the connection be closed, and included a close code and a reason for closing. When receiving this exception, no more messages can be sent. Also, the server is responsible for closing the TCP connection once this exception is received.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.The peer unexpectedly closed the connection while we were trying to receive some data. This is a violation of the websocket RFC since the TCP connection should only be closed after sending and receiving close control messages.GThe client sent garbage, i.e. we could not parse the WebSockets stream. The client sent invalid UTF-8. Note that this exception will only be thrown if strict decoding is set in the connection options.!In order to have an even more high-level API, we define a typeclass for values the user can receive from and send to the socket. A few warnings apply:)Natively, everything is represented as a $, so this is the fastest instanceYou should only use the  or the U instance when you are sure that the data is UTF-8 encoded (which is the case for & messages).^Messages can be very large. If this is the case, it might be inefficient to use the strict  and  instances.%.For an end-user of this library, dealing with Frame|s would be a bit low-level. This is why define another type on top of it, which represents data for the application layer.UThere are currently two kinds of data messages supported by the WebSockets protocol:YTextual UTF-8 encoded data. This corresponds roughly to sending a String in JavaScript.MBinary data. This corresponds roughly to send an ArrayBuffer in JavaScript.&%A textual message. The second field might contain the decoded UTF-8 text for caching reasons. This field is computed lazily so if it's not accessed, it should have no performance impact.'A binary message.(Different control messages,=The kind of message a server application typically deals with.Reserved bits, actual messageMReplace an invalid input byte with the Unicode replacement character U+FFFD.1Throw an error if there is an invalid input byte. !"#$%&'()*+,-.  !$#"%'&()*+,-.  !"#$%&'()*+,-.None/4Lightweight abstraction over an input/output stream.State of the stream0TCreate a stream from a "receive" and "send" action. The following properties apply:Regardless of the provided "receive" and "send" functions, reading and writing from the stream will be thread-safe, i.e. this function will create a receive and write lock to be used internally.'Reading from or writing or to a closed /| will always throw an exception, even if the underlying "receive" and "send" functions do not (we do the bookkeeping). Streams should always be closed./0ReadingWritingResulting stream123456/0123456/0124356 /0123456None7cAn extension is currently allowed to set extra headers and transform the parse/write functions of  Connection.FThis type is very likely to change as other extensions are introduced.789:;< 789:;< <789:;789:;< None Safe =A size limit, in bytes. The " instance takes the minimum limit.@wFour extension parameters are defined for "permessage-deflate" to help endpoints manage per-connection resource usage."server_no_context_takeover""client_no_context_takeover""server_max_window_bits""client_max_window_bits"JSet options for a  Connection@. Please do not use this constructor directly, but rather use Q) and then set the fields you want, e.g.: EmyOptions = defaultConnectionOptions {connectionStrictUnicode = True}GThis way your code does not break if the library introduces new fields.L Whenever a ponga is received, this IO action is executed. It can be used to tickle connections or fire missiles.MEnable @.NxEnable strict unicode on the connection. This means that if a client (or server) sends invalid UTF-8, we will throw a UnicodeExceptionG rather than replacing it by the unicode replacement character U+FFFD.O^The maximum size for incoming frame payload size in bytes. If a frame exceeds this limit, a ParseException is thrown.PconnectionFrameSizeLimit is often not enough since a malicious client can send many small frames to create a huge message. This limit allows you to protect from that. If a message exceeds this limit, a ParseException is thrown.Note that, if compression is enabled, we check the size of the compressed messages, as well as the size of the uncompressed messages as we are deflating them to ensure we don't use too much memory in any case.QThe default connection options:(Nothing happens when a pong is received.Compression is disabled.Lenient unicode decoding.=>?@ABCDEFGHIJKLMNOPQR=?>@ABCDEFGHIJKLMNOPQR=>?@ABCDEFGHIJKLMNOPQR None!"LConvert the parameters to an  that we can put in a 'Sec-WebSocket-Extensions' header.FIf the window_bits parameter is set to 8, we must set it to 9 instead.Related issues: -  )https://github.com/haskell/zlib/issues/11 - (https://github.com/madler/zlib/issues/94Quote from zlib manual:For the current implementation of deflate(), a windowBits value of 8 (a window size of 256 bytes) is not supported. As a result, a request for 8 will result in 9 (a 512-byte window). In that case, providing 8 to inflateInit2() will result in an error when the zlib header with 9 is checked against the initialization of inflate(). The remedy is to not use 8 with deflateInit2() with this initialization, or at least in that case use 9 with inflateInit2(). @ABCDEFR None0Result of demultiplexing(Internal state used by the demultiplexer3Thrown if the client sends invalid multiplexed dataAThe type of a frame. Not all types are allowed for all protocols.0A low-level representation of a WebSocket packet None Parse a frame  NoneAT  NoneZ`According to the RFC, both the client and the server MUST send a close control message to each other. Either party can initiate the first close message but then the other party must respond. Finally, the server is in charge of closing the TCP connection. This IORef tracks if we have sent a close message and are waiting for the peer to respond.[KParameters that allow you to tweak how a request is rejected. Please use n^ and modify fields using record syntax so your code will not break when new fields are added.] The status code, 400 by default.^%The message, "Bad Request" by default_+Extra headers to be sent with the response.`Reponse body of the rejection.a,This datatype allows you to set options for m&. It is strongly recommended to use kl and then modify the various fields, that way new fields introduced in the library do not break your code.c.The subprotocol to speak with the client. If pendingSubprotcols is non-empty, c0 must be one of the subprotocols from the list.d(Extra headers to send with the response.eVA new client connected to the server. We haven't accepted the connection yet, though.gOptions, passed as-is to the Sh,Useful for e.g. inspecting the request path.isOne-shot callback fired when a connection is accepted, i.e., *after* the accepting response is sent to the client.jInput/output streamUtilityl/Accept a pending connection, turning it into a S.mThis function is like l1 but allows you to set custom options using the a datatype.rJReceive an application message. Automatically respond to control messages.BWhen the peer sends a close control message, an exception of type  is thrown. The peer can send a close control message either to initiate a close or in response to a close message we have sent to the peer. In either case the  exception will be thrown. The RFC specifies that the server is responsible for closing the TCP connection, which should happen after receiving the  exception from this function.This will throw ) if the TCP connection dies unexpectedly.s>Receive a message, converting it to whatever format is needed.uSend a %u. This allows you send both human-readable text and binary data. This is a slightly more low-level interface than w or y.vSend a collection of %)s. This is more efficient than calling u many times.wSend a textual message. The message will be encoded as UTF-8. This should be the default choice for human-readable text-based protocols such as JSON.xISend a number of textual messages. This is more efficient than calling w many times.ywSend a binary message. This is useful for sending binary blobs, e.g. images, data encoded with MessagePack, images...zHSend a number of binary messages. This is more efficient than calling y many times.{iSend a friendly close message. Note that after sending this message, you should still continue calling r to process any in-flight messages. The peer will eventually respond with a close control message of its own which will cause r to throw the T exception. This exception is when you can finally consider the connection closed.|:Send a friendly close message and close code. Similar to {, you should continue calling r until you receive a  exception.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.} Send a ping~2Forks a ping thread, sending a ping message every n_ seconds over the connection. The thread dies silently if the connection crashes or is closed.This is useful to keep idle connections open through proxies and whatnot. Many (but not all) proxies have a 60 second default timeout, so based on that sending a ping every 30 seconds is a good idea..STUVWXYZ[\]^_`abcdefghijklmnoConnection to reject#Params on how to reject the requestpConnection to rejectRejection response bodyqrstuvwxyz{|}~B=?>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^]_`abcdefhgijklmnopqrstuvwxyz{|}~Befghijlabcdkmp[\]^_`noSTUVWXYZJKLMNOPQqrstuvwxyz{|}~GHI@ABCDEFR=>?STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None>WebSockets application that can be ran by a server. Once this A action finishes, the underlying socket is closed automatically.Provides a simple server. This function blocks forever. Note that this is merely provided for quick-and-dirty or internal applications, but for real applications, you should use a real server. For example:*Performance is reasonable under load, but:.No protection against DoS attacks is provided.No logging is performed....=Glue for using this package with real servers is provided by: 2https://hackage.haskell.org/package/wai-websockets 3https://hackage.haskell.org/package/websockets-snap A version of , which allows you to customize some options.Create a standardized socket on which you can listen for incomming connections. Should only be used for a quick and dirty solution! Should be preceded by the call .1Turns a socket, connected to some client, into a e. The e should be closed using 6 later.More general version of  for / instead of a .Address to bindPort to listen on Application Never returnsNoneAA client application interacting with a single server. Once this A action finished, the underlying socket is closed automatically.HostPortPathClient applicationHostPortPathOptionsCustom headers to sendClient applicationStreamHostPathConnection optionsCustom headers to sendClient applicationSocketHostPathOptionsCustom headers to sendClient applicationNoneTh  !$#"%'&()*+,-.=?>@ABCDEFGHIJKLMNOPQRS[\^]_`abcdehklmnopqrstuwxy{}~iehhlabcdkmp[\]^_`noSJKLMNOPQGHI@ABCDEFR=>?qrstuwxy{} ,-.()*+%&'!"#$  ~ !"##$$%&'()*+,-./0123456789:63;<=>?@ABCCDEFG H I H J J K L M N O P Q R S S T U V W X Y Z[[\]^_`abbcdefgghijjklmnopqrstuvwxyz{|}~44;                    *websockets-0.12.2.0-2MPIoVHO6Yz4pIsUpjXvVxNetwork.WebSockets.ExtensionsNetwork.WebSocketsNetwork.WebSockets.StreamNetwork.WebSockets.ConnectionNetwork.WebSockets.Hybi13.Mask)Network.WebSockets.Extensions.DescriptionNetwork.WebSockets.HttpNetwork.WebSockets.Types+Network.WebSockets.Extensions.StrictUnicode%Network.WebSockets.Connection.Options/Network.WebSockets.Extensions.PermessageDeflate%Network.WebSockets.Hybi13.DemultiplexNetwork.WebSockets.Hybi13Network.WebSockets.ProtocolNetwork.WebSockets.ServerNetwork.Socket withSocketsDoNetwork.WebSockets.ClientExtensionDescriptionsExtensionDescriptionextName extParamsparseExtensionDescriptionsHandshakeException NotSupportedMalformedRequestMalformedResponseRequestRejectedOtherHandshakeExceptionResponse ResponseHead responseCoderesponseMessageresponseHeadersRequest RequestHead requestPathrequestHeaders requestSecureHeadersgetRequestSubprotocolsConnectionException CloseRequestConnectionClosedParseExceptionUnicodeExceptionWebSocketsDatafromDataMessagefromLazyByteStringtoLazyByteString DataMessageTextBinaryControlMessageClosePingPongMessageStream makeStreammakeSocketStreammakeEchoStreamparseBinparsewriteclose Extension extHeadersextParseextWriteNegotiateExtension SizeLimit NoSizeLimitPermessageDeflateserverNoContextTakeoverclientNoContextTakeoverserverMaxWindowBitsclientMaxWindowBitspdCompressionLevelCompressionOptions NoCompressionPermessageDeflateCompressionConnectionOptionsconnectionOnPongconnectionCompressionOptionsconnectionStrictUnicodeconnectionFramePayloadSizeLimitconnectionMessageDataSizeLimitdefaultConnectionOptionsdefaultPermessageDeflate ConnectionconnectionOptionsconnectionTypeconnectionProtocolconnectionParseconnectionWriteconnectionSentClose RejectRequest rejectCode rejectMessage rejectHeaders rejectBody AcceptRequestacceptSubprotocol acceptHeadersPendingConnectionpendingOptionspendingRequestpendingOnAccept pendingStreamdefaultAcceptRequest acceptRequestacceptRequestWithdefaultRejectRequestrejectRequestWith rejectRequestreceivereceiveDataMessage receiveDatasendsendDataMessagesendDataMessages sendTextData sendTextDatassendBinaryDatasendBinaryDatas sendClose sendCloseCodesendPingforkPingThread ServerApp runServer runServerWithmakeListenSocketmakePendingConnectionmakePendingConnectionFromStream ClientApp runClient runClientWithrunClientWithStreamrunClientWithSocketMaskbaseGHC.WordWord32 parseMask encodeMask randomMask maskPayload c_mask_chunkunMaskExtensionParamparseExtensionDescriptionencodeExtensionDescriptionencodeExtensionDescriptions GHC.Exception ExceptiondecodeRequestHeadencodeResponseHead response101 response400decodeResponseHeadgetRequestSecWebSocketVersion getRequestSecWebSocketExtensionsencodeRequestHead encodeRequestencodeResponsedecodeResponsegetRequestHeadergetResponseHeaderdecodeHeaderLine$fExceptionHandshakeExceptionbytestring-0.10.8.1Data.ByteString.Lazy.Internal ByteString#text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqhData.Text.Internal.LazyData.Text.InternalData.ByteString.InternaldecodeUtf8LenientdecodeUtf8StrictConnectionTypeServerConnectionClientConnection$fExceptionConnectionException$fWebSocketsDataText$fWebSocketsDataText0$fWebSocketsDataByteString$fWebSocketsDataByteString0 StreamStatestreamIn streamOut streamStateClosedOpen strictUnicode strictParseGHC.BaseMonoidatMostSizeLimit$fMonoidSizeLimittoExtensionDescription fixWindowBits toHeadersnegotiateDeflatesetParam parseWindowappTailL maybeStriprejectExtensionsmakeMessageDeflaterdePoppermakeMessageInflaterDemultiplexResultDemultiplexStateDemultiplexException FrameTypeFrameDemultiplexSuccessDemultiplexErrorDemultiplexContinueEmptyDemultiplexStateContinuationFrame TextFrame BinaryFrame CloseFrame PingFrame PongFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex$fExceptionDemultiplexException parseFrameheaderVersions finishRequestfinishResponse encodeMessageencodeMessages encodeFramedecodeMessageshashKey createRequestProtocolHybi13defaultProtocol protocols compatible sendResponsesendAllghc-prim GHC.TypesIO&network-2.6.3.2-IsLM4TXcLoRI0fmmBYVyQzNetwork.Socket.TypesSocketrunApp