IІ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~SafeT)ByteString should be exactly 4 bytes long Apply maskCreate a random maskSafe!" 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.&%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. !"#$%&'()*+,-.  !$#"%'&()*+,-.  !"#$%&'()*+,-. 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 packetNone/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 stream12345/012345/012345/012345 None Parse a frame  NoneAT  None6cAn 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.6789:; 6789:; ;6789:6789:; None!"L[<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"Convert 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().<=>?@ABC <=>?@ABC<=>?@ABC NoneNone!GSet options for a L.I Whenever a ponga is received, this IO action is executed. It can be used to tickle connections or fire missiles.JEnable <.KxEnable strict unicode on the connection. This means that if a client (or server) sends invalid UTF-8, we will throw a  G rather than replacing it by the unicode replacement character U+FFFD.S`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.TKParameters that allow you to tweak how a request is rejected. Please use g^ and modify fields using record syntax so your code will not break when new fields are added.V The status code, 400 by default.W%The message, "Bad Request" by defaultX+Extra headers to be sent with the response.YReponse body of the rejection.Z,This datatype allows you to set options for f&. It is strongly recommended to use dl and then modify the various fields, that way new fields introduced in the library do not break your code.\.The subprotocol to speak with the client. If pendingSubprotcols is non-empty, \0 must be one of the subprotocols from the list.](Extra headers to send with the response.^VA new client connected to the server. We haven't accepted the connection yet, though.`Options, passed as-is to the La,Useful for e.g. inspecting the request path.bsOne-shot callback fired when a connection is accepted, i.e., *after* the accepting response is sent to the client.cInput/output streamUtilitye/Accept a pending connection, turning it into a L.fThis function is like e1 but allows you to set custom options using the Z datatype.lJReceive 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.m>Receive a message, converting it to whatever format is needed.oSend a %pSend a collection of %sqSend a message as textr%Send a collection of messages as textsSend a message as binary datat,Send a collection of messages as binary datauiSend a friendly close message. Note that after sending this message, you should still continue calling l to process any in-flight messages. The peer will eventually respond with a close control message of its own which will cause l to throw the T exception. This exception is when you can finally consider the connection closed.v:Send a friendly close message and close code. Similar to u, you should continue calling l until you receive a  exception.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.w Send a pingx2Forks a ping thread, sending a ping message every n_ seconds over the connection. The thread dies silently if the connection crashes or is closed.7DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghConnection to reject#Params on how to reject the requestiConnection to rejectRejection response bodyjklmnopqrstuvwx=<=>?@ABCDEFGHJKILMNOPQRSTUWVXYZ[\]^_a`bcdefghijklmnopqrstuvwx=^_`abceZ[\]dfiTUVWXYghLMNOPQRSGHIJKjklmnopqrstuvwxDEF<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxNone{>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 standalone applications, for real applications, you should use a real server.=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 ^. The ^ should be closed using 5 later.More general version of  for / instead of a .{|Address to bindPort to listen on Application Never returns}~{|}~{|}~NoneAA 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 applicationNoneTc  !$#"%'&()*+,-.<=>?@ABCDEFGHJKILTUWVXYZ[\]^adefghijklmnoqrsuwx{|}~d^aaeZ[\]dfiTUVWXYghLGHIJKjDEF<=>?@ABCklmnoqrsuw ,-.()*+%&'!"#$  {|}~x !""##$%&'()*+,-./012345678952:;<=>?@AABCDE F F G H I J K LMNOPPQRSTTUVWXYZ[[\]^_``abccdefghijklmnopqrstuvwxyz{|}~33                   :   *websockets-0.11.0.0-Elg08lMoLhNCFP1h3gCgIVNetwork.WebSockets.ExtensionsNetwork.WebSocketsNetwork.WebSockets.StreamNetwork.WebSockets.ConnectionNetwork.WebSockets.Hybi13.Mask)Network.WebSockets.Extensions.DescriptionNetwork.WebSockets.HttpNetwork.WebSockets.Types%Network.WebSockets.Hybi13.DemultiplexNetwork.WebSockets.Hybi13Network.WebSockets.Protocol/Network.WebSockets.Extensions.PermessageDeflate+Network.WebSockets.Extensions.StrictUnicodeNetwork.WebSockets.ServerNetwork.Socket withSocketsDoNetwork.WebSockets.ClientExtensionDescriptionsExtensionDescriptionextName extParamsparseExtensionDescriptionsHandshakeException NotSupportedMalformedRequestMalformedResponseRequestRejectedOtherHandshakeExceptionResponse ResponseHead responseCoderesponseMessageresponseHeadersRequest RequestHead requestPathrequestHeaders requestSecureHeadersgetRequestSubprotocolsConnectionException CloseRequestConnectionClosedParseExceptionUnicodeExceptionWebSocketsDatafromDataMessagefromLazyByteStringtoLazyByteString DataMessageTextBinaryControlMessageClosePingPongMessageStream makeStreammakeSocketStreammakeEchoStreamparsewriteclose Extension extHeadersextParseextWriteNegotiateExtensionPermessageDeflateserverNoContextTakeoverclientNoContextTakeoverserverMaxWindowBitsclientMaxWindowBitspdCompressionLeveldefaultPermessageDeflateCompressionOptions NoCompressionPermessageDeflateCompressionConnectionOptionsconnectionOnPongconnectionCompressionOptionsconnectionStrictUnicode ConnectionconnectionOptionsconnectionTypeconnectionProtocolconnectionParseconnectionWriteconnectionSentClose RejectRequest rejectCode rejectMessage rejectHeaders rejectBody AcceptRequestacceptSubprotocol acceptHeadersPendingConnectionpendingOptionspendingRequestpendingOnAccept pendingStreamdefaultAcceptRequest acceptRequestacceptRequestWithdefaultRejectRequestrejectRequestWith rejectRequestdefaultConnectionOptionsreceivereceiveDataMessage receiveDatasendsendDataMessagesendDataMessages sendTextData sendTextDatassendBinaryDatasendBinaryDatas sendClose sendCloseCodesendPingforkPingThread$fEqCompressionOptions$fShowCompressionOptions ServerApp runServer runServerWithmakeListenSocketmakePendingConnectionmakePendingConnectionFromStream ClientApp runClient runClientWithrunClientWithStreamrunClientWithSocketMask maskPayload randomMaskExtensionParamparseExtensionDescriptionencodeExtensionDescriptionencodeExtensionDescriptionsbase GHC.Exception ExceptiondecodeRequestHeadencodeResponseHead response101 response400decodeResponseHeadgetRequestSecWebSocketVersion getRequestSecWebSocketExtensionsencodeRequestHead encodeRequestencodeResponsedecodeResponsegetRequestHeadergetResponseHeaderdecodeHeaderLine$fExceptionHandshakeExceptionbytestring-0.10.8.1Data.ByteString.Lazy.Internal ByteString#text-1.2.2.1-9Yh8rJoh8fO2JMLWffT3QsData.Text.Internal.LazyData.Text.InternalData.ByteString.InternaldecodeUtf8LenientdecodeUtf8StrictConnectionTypeServerConnectionClientConnection$fExceptionConnectionException$fWebSocketsDataText$fWebSocketsDataText0$fWebSocketsDataByteString$fWebSocketsDataByteString0DemultiplexResultDemultiplexStateDemultiplexException FrameTypeFrameDemultiplexSuccessDemultiplexErrorDemultiplexContinueEmptyDemultiplexStateContinuationFrame TextFrame BinaryFrame CloseFrame PingFrame PongFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex$fExceptionDemultiplexException StreamStatestreamIn streamOut streamStateClosedOpen parseFrameheaderVersions finishRequestfinishResponse encodeMessageencodeMessages encodeFramedecodeMessageshashKey createRequestProtocolHybi13defaultProtocol protocols compatibletoExtensionDescription fixWindowBits toHeadersnegotiateDeflatesetParam parseWindowappTailL maybeStriprejectExtensionsmakeMessageDeflaterdePoppermakeMessageInflater strictUnicode strictParse sendResponsesendAllghc-prim GHC.TypesIO&network-2.6.3.1-G4Up1CPKbp7DeFsnywOnGGNetwork.Socket.TypesSocketrunApp