ú΋öQU      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST Safe-InferredU*ByteString should be exactly 4 bytes long V Apply mask WCreate a random mask UVWUVWUVWNoneHIn order to have an even more high-level API, we define a typeclass for I values the user can receive from and send to the socket. A few warnings  apply: * Natively, everything is represented as a X, so this is the  fastest instance  You should only use the Y or the Z instance when you are > sure that the data is UTF-8 encoded (which is the case for   messages). M Messages can be very large. If this is the case, it might be inefficient to  use the strict [ and Z instances. .For an end-user of this library, dealing with Frames would be a bit K 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 with The connection couldn'4t be established or broke down unexpectedly. thrown  as an iteratee exception. 'the client closed the connection while & we were trying to receive some data. "todo: Also want this for sending.  The client sent malformed data.  \]^_`     \]^_`Nonea)Internal state used by the demultiplexer bBThe type of a frame. Not all types are allowed for all protocols. c1A low-level representation of a WebSocket packet adebfghijkclmnopqrstabfghijkclmnopqrstadebkjihgfclmnopqrstNoneuvwxyzuvwxyzuvwxyzNoneAError in case of failed handshake. Will be thrown as an iteratee  exception. ({ condition). MTODO: This should probably be in the Handshake module, and is solely here to  prevent a cyclic dependency.  for example EOF came too early# (which is actually a parse error)  or for your own errors. (like  unknown path?) ?The request was well-formed, but the library user rejected it.  (e.g.  unknown path) CThe servers response was somehow invalid (missing headers or wrong  security token) CThe request was somehow invalid (missing headers or wrong security  token) We don'9t have a match for the protocol requested by the client.  todo: version parameter A response including a body Response to a $ A request with a body 3(Internally used) HTTP headers and requested path. $0Full request type, including the response to it )Request headers |Get the Sec-WebSocket-Version header }RequestHttpPart encoder ~RequestBody encoder Parse an initial request € Encode an HTTP upgrade response An upgrade response ‚ Bad request ƒHTTP response parser ' !"#$%&'()|}~€„‚ƒ…†‡ˆ% !"#$%&'()|}~€„‚ƒ…† !"#$%&'()|}~€„‚ƒ…†‡ˆ None‰Unique identifier for us. ŠVersion accepted in the Sec-WebSocket-Version  header. This is ) usually not the same, or derivable from version, e.g. for hybi10, it's  7, 8 or 17. ‹DDetermine if the protocol is compatible with a requested version. A . default implementation exists which uses the headerVersions of the  protocol. ŒEncodes messages to binary "s. Takes a random source so it is 6 able to do masking of frames (needed in some cases). ŽDecodes messages from binary [s.  Create a Request3 that can be sent to the websockets server to open  the connection. EParse and validate the rest of the request. For hybi10, this is just . validation, but hybi00 also needs to fetch a security token .In case of failure, this function may throw a . 3 be amended with the RequestHttpPart for the user) ‘DParse and validate the handshake response received from the server. ’%Implementations of the specification -Construct a close message .Construct a ping message /Construct a pong message 0Construct a text message 1Construct a binary message *+,‰Š‹Œ Protocol Mask messages Random source ŽHostname of the server. Path %Origin where we are connecting from. Protocols list. $Is the connection secure, i.e. wss. %HTTP request that can be sent to the - to the server to initiate the connection. ‘’-./01*+,‰Š‹ŒŽ‘’-./01*+, ‰Š‹ŒŽ‘’-./01 None“”•–—˜™š“”“”•–—˜™š None›Encode a frame œParse a frame žŸ› ¡œ¢£¤¥¦§¨ž› žŸ› ¡œ¢£¤¥¦§¨ None2©ª«“”22©ª« None3¬­®¯33¬­®¯None°KReceives and checks the client handshake. If no suitable protocol is found " (or the client sends garbage), a  will be thrown. ±FRespond to errors encountered during handshake. First argument may be  bottom. °±°±°±None4@The monad in which you can write WebSocket-capable applications 5Used for asynchronous sending. ²Environment in which the 4 monad actually runs 6"Options for the WebSocket program 9Default options :9Receives the initial client handshake, then behaves like <. ;9Receives the initial client handshake, then behaves like  =. <Run a 4 application on an 'Enumerator'/'Iteratee' pair, given L that you (read: your web server) has already received the HTTP part of the 0 initial request. If not, you might want to use ;  instead. "If the handshake failed, throws a . Otherwise, executes the G supplied continuation. You should still send a response to the client  yourself. = Version of <, which allows you to specify custom options >spawnPingThread n* spawns a thread which sends a ping every n seconds M (if the protocol supports it). To be called after having sent the response. ³Receive arbitrary data. ´3Execute an iteratee, wrapping attoparsec-enumeratee's ParseError into the 6 ParseError constructor (which is a ConnectionError). ?Receive a message µSend an arbitrary  @$Low-level sending with an arbitrary  AHSend a message to a sink. Might generate an exception if the underlying  connection is closed. BHIn case the user of the library wants to do asynchronous sending to the  socket, he can extract a 5* and pass this value around, for example,  to other threads. ¶Get the current configuration ·Get the underlying protocol C Find out the 4 version used at runtime D0Throw an iteratee error in the WebSockets monad E0Catch an iteratee error in the WebSockets monad ¸+Lift an Iteratee computation to WebSockets &4¹º5»¼²½¾¿ÀÁ6789:;<=ÂOptions  Protocol  Need to mask App  Out iteratee Resulting iteratee Ã>³´?µ@ABÄŶ·CDE¸4¹º56789:;<=ÂÃ>³?µ@AB¶·CDE4¹º5»¼²½¾¿ÀÁ6789:;<=ÂÃ>³´?µ@ABÄŶ·CDE¸NoneFGProvides a simple server. This function blocks forever. Note that this J is merely provided for quick-and-dirty standalone applications, for real - applications, you should use a real server. GThis function wraps <& in order to provide a simple API for  stand-alone servers. H6Create an iterator which writes to a socket. Throws a  = exception if the user attempts to write to a closed socket. FAddress to bind to Port to listen on Application to serve Never returns GHFGHFGHNoneHHNoneIHost Port Path Client application JHost Port Path *Origin, if Nothing then server interprets , connection as not coming from a browser. Protocol List Client application ÆSocket Host Path Origin, if Nothing then server ' interprets connection as not coming  from a browser. Protocol List Client application ÇIJÆIJÆÇNoneKKReceive an application message. Automatically respond to control messages. L5Receive a message, treating it as data transparently ÈSend a  to the socket immediately. MSend a text message NSend some binary data OKReject a request, sending a 400 (Bad Request) to the client and throwing a " RequestRejected (HandshakeError) PHAccept a request. After this, you can start sending and receiving data. KLÈMNOÉPP  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGIJKLMNOPP67894<=:;,+*23FG)$%&'( !"#  POC?KL@MN5AB-./01>DE IJKLÈMNOÉPNoneQ1A handle which keeps track of subscribed clients R Create a new Q, handle, with no clients initally connected S-Broadcast a message to all connected clients TBlocks forever QÊËÌÍÎÏÐRSTQRSTQRSTQÊËÌÍÎÏÐRSTÑ !"#$%&'())**+,-..//012334567 8 9 : ; < = > ? @ ABCDDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghihjekglmnopqrsqtuvwxyzs{|}~€‚ƒ;<=>?„…†‡ˆ‰Š‹ŒŽ‘’“ ” • – —˜™š › œ ž Ÿ     ¡ ¢ £ ¤ ¥ ¦ § ¨ © © ª « ¬ ­ ® ¯ ° ± ² ³ @ ´ µ A ¶ · ¸¹º»¼½¾¿ÀÁBÂCûÄÅÆÇÈÉÊËÌÍÎÏ^ÐÐÑÒÓÔÕwebsockets-0.7.4.1Network.WebSocketsNetwork.WebSockets.InternalNetwork.WebSockets.Util.PubSub'Network.WebSockets.Protocol.Hybi10.MaskNetwork.WebSockets.Types.Network.WebSockets.Protocol.Hybi10.Demultiplex"Network.WebSockets.Protocol.Unsafe!Network.WebSockets.Handshake.HttpNetwork.WebSockets.Protocol+Network.WebSockets.Protocol.Hybi00.Internal+Network.WebSockets.Protocol.Hybi10.Internal"Network.WebSockets.Protocol.Hybi00"Network.WebSockets.Protocol.Hybi10Network.WebSockets.HandshakeNetwork.WebSockets.MonadTMessageNetwork.WebSockets.SocketNetwork.WebSockets.ClientIResponseWebSocketsDatafromLazyByteStringtoLazyByteString DataMessageBinaryTextControlMessagePongPingCloseConnectionErrorConnectionClosed ParseErrorHandshakeErrorOtherHandshakeErrorRequestRejectedMalformedResponseMalformedRequest NotSupported ResponseBodyResponseHttpPartresponseHttpCoderesponseHttpMessageresponseHttpHeaders RequestBodyRequestHttpPartrequestHttpPathrequestHttpHeadersrequestHttpSecureRequest requestPathrequestHeadersrequestResponseHeadersBinaryProtocol TextProtocolProtocolclosepingpongtextData binaryDataHybi00Hybi10 WebSocketsSinkWebSocketsOptionsonPongdefaultWebSocketsOptionsrunWebSocketsHandshakerunWebSocketsWithHandshake runWebSocketsrunWebSocketsWithspawnPingThreadreceivesendsendSinkgetSink getVersion throwWsError catchWsError runServer runWithSocket iterSocketconnect connectWithreceiveDataMessage receiveData sendTextDatasendBinaryData rejectRequest acceptRequestPubSub newPubSubpublish subscribeMask maskPayload randomMaskbytestring-0.10.0.2Data.ByteString.Lazy.Internal ByteString text-0.11.3.1Data.Text.Lazy.InternalData.Text.InternalData.ByteString.Internal$fWebSocketsDataText$fWebSocketsDataText0$fWebSocketsDataByteString$fWebSocketsDataByteString0$fExceptionConnectionErrorDemultiplexState FrameTypeFrameunDemultiplexState PongFrame PingFrame CloseFrame BinaryFrame TextFrameContinuationFrameframeFin frameRsv1 frameRsv2 frameRsv3 frameType framePayloademptyDemultiplexState demultiplex castMessagetransformers-0.3.0.0Control.Monad.Trans.ErrorErrorgetSecWebSocketVersionencodeRequestHttpPartencodeRequestBody decodeRequestencodeResponseHttpPart response101 response400decodeResponseencodeResponseBodygetRequestHeadergetResponseHeader$fExceptionHandshakeError$fErrorHandshakeErrorversionheaderVersions supportedencodeMessagesblaze-builder-0.3.1.1'Blaze.ByteString.Builder.Internal.TypesBuilderdecodeMessages createRequest finishRequestfinishResponseimplementationsHybi00_ encodeMessage parseMessage divBySpaceshandshakeHybi00$fTextProtocolHybi00_$fProtocolHybi00_encodeFrameHybi10 parseFrameHybi10_encodeMessageHybi10decodeMessagesHybi10demultiplexEnumhandshakeHybi10createRequestHybi10finishResponseHybi10 hashKeyHybi10$fBinaryProtocolHybi10_$fTextProtocolHybi10_$fProtocolHybi10_$fTextProtocolHybi00$fProtocolHybi00$fBinaryProtocolHybi10$fTextProtocolHybi10$fProtocolHybi10 handshake responseError WebSocketsEnvreceiveIterateewrappingParseError sendBuilder getOptions getProtocol liftIteratee unWebSocketsunSink envOptionsenvSendBuilderenvSink envProtocolrunWebSocketsWith'makeBuilderSender singletonbuilderToByteStringconnectWithSocketrunWebSocketsClient sendResponsefailHandshakeWithPubSub_ pubSubNextId pubSubSinks addClient removeClient