úÎpåh×J      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ*ByteString should be exactly 4 bytes long K Apply mask LCreate a random mask JKLJKLHIn 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 M, so this is the  fastest instance  You should only use the N or the O 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 P and O 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.     Q)Internal state used by the demultiplexer RSTBThe type of a frame. Not all types are allowed for all protocols. UVWXYZ[1A low-level representation of a WebSocket packet \]^_`aQTUVWXYZ[\]^_`aQTZYXWVUUVWXYZ[\]^_\]^_`abcdefgbcdefgbcdefgAError in case of failed handshake. Will be thrown as an iteratee  exception. (h 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 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 Response to a  Full request type  3(Internally used) HTTP headers and requested path. !"#$Request headers iGet the Sec-WebSocket-Version header jParse an initial request k Encode an HTTP upgrade response lAn upgrade response m Bad request  !"#$ijklm !"#!"#$ijklm%&'nUnique identifier for us. oVersion 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. pDDetermine if the protocol is compatible with a requested version. A . default implementation exists which uses the headerVersions of the  protocol. qEncodes messages to binary r"s. Takes a random source so it is 6 able to do masking of frames (needed in some cases). sDecodes messages from binary Ps. tEParse 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) u%Implementations of the specification (Construct a close message )Construct a ping message *Construct a pong message +Construct a text message ,Construct a binary message %&'nopqstu()*+,%&'nopqstunopqstu()*+, vwxyz{vwvww |}~Encode a frame €‚Parse a frame ƒ|}|}} -„vw-- .….. †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. †‡†‡&/@The monad in which you can write WebSocket-capable applications ˆ‰0Used for asynchronous sending. Š‹ŒEnvironment in which the / monad actually runs Ž‘1"Options for the WebSocket program 234Default options 59Receives the initial client handshake, then behaves like 7. 69Receives the initial client handshake, then behaves like  8. 7Run a / 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 6  instead. "If the handshake failed, throws a . Otherwise, executes the G supplied continuation. You should still send a response to the client  yourself. 8 Version of 7, which allows you to specify custom options ’“9spawnPingThread 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 r ;$Low-level sending with an arbitrary  T.Message <HSend a message to a sink. Might generate an exception if the underlying  connection is closed. =HIn case the user of the library wants to do asynchronous sending to the  socket, he can extract a 0* and pass this value around, for example,  to other threads. —˜™Get the current configuration šGet the underlying protocol > Find out the / version used at runtime ?0Throw an iteratee error in the WebSockets monad @0Catch an iteratee error in the WebSockets monad ›+Lift an Iteratee computation to WebSockets /ˆ‰012345678’9:–;<=™š>?@/ˆ‰ˆ‰01232345678’9:–;<=™š>?@AGProvides 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. Address to bind to Port to listen on Application to serve Never returns BThis function wraps 7& in order to provide a simple API for  stand-alone servers. C6Create an iterator which writes to a socket. Throws a  = exception if the user attempts to write to a closed socket. ABCABCCCDKReceive an application message. Automatically respond to control messages. E5Receive a message, treating it as data transparently œSend a  to the socket immediately. FSend a text message GSend some binary data HKReject a request, sending a 400 (Bad Request) to the client and throwing a " RequestRejected (HandshakeError) IHAccept a request. After this, you can start sending and receiving data. I  !"#$%&'()*+,-./0123456789:;<=>?@ABDEFGHII1234/7856'&%-.AB$ !"#  IH>:DE;FG0<=()*+,9?@ DEFGHIž !"##$%&'(()*+,,-./01234567 8 9:;<<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Z\W]Y^^_`abcdefgghijklm34567nopqrstuvwxyz{|}~ € €  ‚ ƒ „ … … † ‡ ˆ ‰ Š ‹ 8 9 Œ :Ž;‘’“”•–—˜™š›œžŸ ¡websockets-0.5.1.0Network.WebSocketsNetwork.WebSockets.Internal'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.MonadNetwork.WebSockets.SocketWebSocketsDatafromLazyByteStringtoLazyByteString DataMessageBinaryTextControlMessagePongPingCloseMessageConnectionErrorConnectionClosed ParseErrorHandshakeErrorOtherHandshakeErrorRequestRejectedMalformedRequest NotSupportedResponse responseCoderesponseMessageresponseHeaders responseBodyRequest requestPathrequestHeadersrequestResponseRequestHttpPartrequestHttpPathrequestHttpHeadersHeadersBinaryProtocol TextProtocolProtocolclosepingpongtextData binaryDataHybi00Hybi10 WebSocketsSinkWebSocketsOptionsonPongdefaultWebSocketsOptionsrunWebSocketsHandshakerunWebSocketsWithHandshake runWebSocketsrunWebSocketsWithspawnPingThreadreceivesendsendSinkgetSink getVersion throwWsError catchWsError runServer runWithSocket iterSocketreceiveDataMessage receiveData sendTextDatasendBinaryData rejectRequest acceptRequestMask maskPayload randomMaskbytestring-0.9.2.0Data.ByteString.Lazy.Internal ByteStringtext-0.11.1.12Data.Text.Lazy.InternalData.Text.InternalData.ByteString.InternalDemultiplexStateunDemultiplexState FrameType PongFrame PingFrame CloseFrame BinaryFrame TextFrameContinuationFrameFrameframeFin frameType framePayloademptyDemultiplexState demultiplex castMessagetransformers-0.2.2.0Control.Monad.Trans.ErrorErrorgetSecWebSocketVersion decodeRequestencodeResponse response101 response400versionheaderVersions supportedencodeMessagesblaze-builder-0.3.0.2'Blaze.ByteString.Builder.Internal.TypesBuilderdecodeMessages finishRequestimplementationsHybi00_ encodeMessage parseMessage divBySpaceshandshakeHybi00Hybi10_encodeMessageHybi10encodeFrameHybi10decodeMessagesHybi10demultiplexEnum parseFramehandshakeHybi10 handshake responseError unWebSocketsunSink WebSocketsEnv envOptionsenvSendBuilderenvSink envProtocolrunWebSocketsWith'makeBuilderSenderreceiveIterateewrappingParseError sendBuilder singletonbuilderToByteString getOptions getProtocol liftIteratee sendResponsefailHandshakeWith