`xA_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^  Safe-InferredM_)ByteString should be exactly 4 bytes long` Apply maskaCreate a random mask_`a_`a_`aNone+8Error in case of failed handshake. Will be thrown as an b.jTODO: This should probably be in the Handshake module, and is solely here to prevent a cyclic dependency.rfor example "EOF came too early" (which is actually a parse error) or for your own errors. (like "unknown path"?)UThe request was well-formed, but the library user rejected it. (e.g. "unknown path")SThe servers response was somehow invalid (missing headers or wrong security token)JThe request was somehow invalid (missing headers or wrong security token)XWe don't have a match for the protocol requested by the client. todo: version parameterA response including a bodyHTTP response, without body. A request with a body2An HTTP request. The request body is not yet read.Request headerscParse an initial requestdEncode an HTTP upgrade responseeAn upgrade responsef Bad requestgHTTP response parserhGet 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.$ ijcdkefglmnhop" ijcdkefglmnh ijcdkefglmnhopNone+JVarious exceptions that can occur while receiving or transmitting messagesGThe client sent garbage, i.e. we could not parse the WebSockets stream.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. 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.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 q$, so this is the fastest instanceYou should only use the r or the sU 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 t and s 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. Different control messages$=The kind of message a server application typically deals withuvw !"#$%&xyz{|uvw !"#$%& uwv #"!$&%xyz{|None'4Lightweight abstraction over an input/output stream.}State of the stream'~}(ReadingWritingResulting stream)*+,-'()*+,-'()*+,-'~}()*+,-None+(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 Parse a frame  None:M  None.Set options for a 1.0 Whenever a ponga is received, this IO action is executed. It can be used to tickle connections or fire missiles.9`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.:5Type representing an available or unavailable stream.?.The subprotocol to speak with the client. If pendingSubprotcols is non-empty, ?0 must be one of the subprotocols from the list.@VA new client connected to the server. We haven't accepted the connection yet, though.BOptions, passed as-is to the 1C,Useful for e.g. inspecting the request path.DsOne-shot callback fired when a connection is accepted, i.e., *after* the accepting response is sent to the client.EInput/output streamUtilityKJReceive 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.L>Receive a message, converting it to whatever format is needed.NSend a OSend a message as textPSend a message as binary dataQiSend a friendly close message. Note that after sending this message, you should still continue calling K to process any in-flight messages. The peer will eventually respond with a close control message of its own which will cause K to throw the T exception. This exception is when you can finally consider the connection closed.R:Send a friendly close message and close code. Similar to Q, you should continue calling K until you receive a  exception.See  .http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.S Send a pingT2Forks a ping thread, sending a ping message every n_ seconds over the connection. The thread dies silently if the connection crashes or is closed.(./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST'./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST'@ABCDE=>?FGH:<;123456789./0IJKLMNOPQRST./0123456789:<;=>?@ABCDEFGHIJKLMNOPQRST NoneU>WebSockets application that can be ran by a server. Once this A action finishes, the underlying socket is closed automatically.VProvides 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.W A version of V, which allows you to customize some options.XCreate 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  .Y1Turns a socket, connected to some client, into a @.UVAddress to bindPort to listen on Application Never returnsWXYUVWXYUVWXY NoneZAA client application interacting with a single server. Once this A action finished, the underlying socket is closed automatically.Z[HostPortPathClient application\HostPortPathOptionsCustom headers to sendClient application]StreamHostPathConnection optionsCustom headers to sendClient application^SocketHostPathOptionsCustom headers to sendClient applicationZ[\]^Z[\]^NoneMH  !"#$%&./01=>?@CFGHIJKLMNOPQSTUVWXYZ[\]^I@CC=>?FGH1./0IJKLMNOPQS  $&% #"!UVWXYZ[\^]T !"#$%&'()*+,-.'*/012345667889:;<=>?@A@BBCDDEFGHIJKLMNOPQRSTUVW X Y Z [ \ ] ^ _ ` abcdefghijklmnopqrstuvwxyz)y{)v|x}~/A    websockets-0.9.3.0Network.WebSocketsNetwork.WebSockets.StreamNetwork.WebSockets.ConnectionNetwork.WebSockets.Hybi13.MaskNetwork.WebSockets.HttpNetwork.WebSockets.Types%Network.WebSockets.Hybi13.DemultiplexNetwork.WebSockets.Hybi13Network.WebSockets.ProtocolNetwork.WebSockets.ServerNetwork.Socket withSocketsDoNetwork.WebSockets.ClientHandshakeExceptionOtherHandshakeExceptionRequestRejectedMalformedResponseMalformedRequest NotSupportedResponse ResponseHead responseCoderesponseMessageresponseHeadersRequest RequestHead requestPathrequestHeaders requestSecureHeadersgetRequestSubprotocolsConnectionExceptionParseExceptionConnectionClosed CloseRequestWebSocketsDatafromLazyByteStringtoLazyByteString DataMessageBinaryTextControlMessagePongPingCloseMessageStream makeStreammakeSocketStreammakeEchoStreamparsewritecloseConnectionOptionsconnectionOnPong ConnectionconnectionOptionsconnectionTypeconnectionProtocolconnectionParseLockconnectionWriteLockconnectionStreamconnectionSentCloseDecoderEncoderClosed AcceptRequestacceptSubprotocolPendingConnectionpendingOptionspendingRequestpendingOnAccept pendingStream acceptRequestacceptRequestWith rejectRequestdefaultConnectionOptionsreceivereceiveDataMessage receiveDatasendsendDataMessage sendTextDatasendBinaryData sendClose sendCloseCodesendPingforkPingThread ServerApp runServer runServerWithmakeListenSocketmakePendingConnection ClientApp runClient runClientWithrunClientWithStreamrunClientWithSocketMask maskPayload randomMaskbase GHC.Exception ExceptiondecodeRequestHeadencodeResponseHead response101 response400decodeResponseHeadgetRequestSecWebSocketVersionencodeRequestHead encodeRequestencodeResponsedecodeResponsegetRequestHeadergetResponseHeaderdecodeHeaderLine$fExceptionHandshakeExceptionbytestring-0.10.4.0Data.ByteString.Lazy.Internal ByteString text-1.2.0.4Data.Text.Internal.LazyData.Text.InternalData.ByteString.InternalConnectionTypeClientConnectionServerConnection$fExceptionConnectionException$fWebSocketsDataText$fWebSocketsDataText0$fWebSocketsDataByteString$fWebSocketsDataByteString0 StreamStatestreamIn streamOut streamStateOpenDemultiplexStateDemultiplexException FrameTypeFrameEmptyDemultiplexState PongFrame PingFrame CloseFrame BinaryFrame TextFrameContinuationFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex$fExceptionDemultiplexException parseFrameheaderVersions finishRequestfinishResponse encodeMessageencodeMessages encodeFramedecodeMessageshashKey createRequestProtocolHybi13defaultProtocol protocols compatible sendResponseghc-prim GHC.TypesIOrunApp