úÎpĈhĞI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI*ByteString should be exactly 4 bytes long J Apply mask KCreate a random mask IJKIJKHIn 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 L, so this is the  fastest instance  You should only use the M or the N 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 O and N 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.     P)Internal state used by the demultiplexer QRSBThe type of a frame. Not all types are allowed for all protocols. TUVWXYZ1A low-level representation of a WebSocket packet [\]^_`PSTUVWXYZ[\]^_`PSYXWVUTTUVWXYZ[\]^[\]^_`abcdefabcdefabcdefAError in case of failed handshake. Will be thrown as an iteratee  exception. (g 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 hGet the Sec-WebSocket-Version header iParse an initial request j Encode an HTTP upgrade response kAn upgrade response l Bad request  !"#$hijkl !"#!"#$hijkl%&'mUnique identifier for us. nVersion 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. oDDetermine if the protocol is compatible with a requested version. A . default implementation exists which uses the headerVersions of the  protocol. pEncodes messages to binary q"s. Takes a random source so it is 6 able to do masking of frames (needed in some cases). rDecodes messages from binary Os. sEParse 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) t%Implementations of the specification (Construct a close message )Construct a ping message *Construct a pong message +Construct a text message ,Construct a binary message %&'mnoprst()*+,%&'mnoprstmnoprst()*+,uvwxyzuvuvv {|}~Encode a frame €Parse a frame ‚{|~{||~ -ƒuv-- .„.. …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 q ;$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. ›ECreate an enumerator which reads from a socket and yields the chunks œ,Create an iterator which writes to a socket AB›œAB›œCKReceive an application message. Automatically respond to control messages. D5Receive a message, treating it as data transparently Send a  to the socket immediately. ESend a text message FSend some binary data GKReject a request, sending a 400 (Bad Request) to the client and throwing a " RequestRejected (HandshakeError) žHHAccept a request. After this, you can start sending and receiving data. I  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI1234/7856'&%-.AB$ !"#  HG>:CD;EF0<=()*+,9?@ CDEFGHŸ !""#$%&''()*++,-./0123456 7 8 9 : ; ; < = > ? @ A B C D E F G H IJKLMNOPQRSTUVWXYXZU[W\\]^_`abcdeefghijk23456lmnopqrstuvwxyz{|}~~€‚ ƒ ƒ „ … † ‡ ˆ ‰ 7 8 Š ‹ 9 Œ :  Ž Ž   ‘ ’ “ ” • – — ˜ ™ š › œžŸ Ħwebsockets-0.5.0.0Network.WebSockets'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 runWithSocketreceiveDataMessage 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 receiveEnumsendIter sendResponsefailHandshakeWith