-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Push XML from/to client to/from server over XMPP or HTTP -- -- examples/TestSimple.hs -- -- extensions -- --
-- module TestSimple (testSimple) where -- -- import Control.Monad -- import Control.Concurrent -- import Data.Maybe -- import Data.Pipe -- import Data.Pipe.ByteString -- import System.IO -- import Text.XML.Pipe -- import Network.XmlPush -- import Network.XmlPush.Simple -- -- testSimple :: Handle -> IO () -- testSimple h = do -- (sp :: SimplePusher Handle) <- generate (One h) () -- void . forkIO . runPipe_ $ readFrom sp -- =$= convert (xmlString . (: [])) -- =$= toHandle stdout -- runPipe_ $ fromHandle stdin -- =$= xmlEvent -- =$= convert fromJust -- =$= xmlNode [] -- =$= writeTo sp ---- -- examples/simpleClient -- --
-- import Network -- import TestSimple -- -- main :: IO () -- main = testSimple =<< connectTo "localhost" (PortNumber 54492) ---- -- examples/simpleServer -- --
-- import Control.Monad -- import Control.Concurrent -- import Network -- -- import TestSimple -- -- main :: IO () -- main = forever . (void . forkIO . testSimple . fst3 =<<) . accept -- =<< listenOn (PortNumber 54492) -- -- fst3 :: (a, b, c) -> a -- fst3 (x, _, _) = x --@package xml-push @version 0.0.0.18 module Network.XmlPush class XmlPusher xp where type family NumOfHandle xp :: * -> * type family PusherArgs xp :: * -> * generate :: (XmlPusher xp, ValidateHandle h, MonadBaseControl IO (HandleMonad h), MonadError (HandleMonad h), SaslError (ErrorType (HandleMonad h))) => NumOfHandle xp h -> PusherArgs xp h -> HandleMonad h (xp h) readFrom :: (XmlPusher xp, HandleLike h, MonadBase IO (HandleMonad h)) => xp h -> Pipe () XmlNode (HandleMonad h) () writeTo :: (XmlPusher xp, HandleLike h, MonadBase IO (HandleMonad h)) => xp h -> Pipe XmlNode () (HandleMonad h) () data Zero a Zero :: Zero a data One a One :: a -> One a data Two a Two :: (Maybe a) -> (Maybe a) -> Two a instance Show (Zero a) instance Show a => Show (One a) module Network.XmlPush.Simple data SimplePusher h data SimplePusherArgs h SimplePusherArgsNull :: SimplePusherArgs h instance XmlPusher SimplePusher module Network.XmlPush.Xmpp data Xmpp h data XmppArgs h XmppArgs :: [ByteString] -> Jid -> ByteString -> Jid -> (XmlNode -> Bool) -> (XmlNode -> Bool) -> XmppArgs h mechanisms :: XmppArgs h -> [ByteString] myJid :: XmppArgs h -> Jid passowrd :: XmppArgs h -> ByteString yourJid :: XmppArgs h -> Jid iNeedResponse :: XmppArgs h -> XmlNode -> Bool youNeedResponse :: XmppArgs h -> XmlNode -> Bool instance XmlPusher Xmpp module Network.XmlPush.Xmpp.Tls data XmppTls h data XmppTlsArgs h XmppTlsArgs :: Bool -> (XmppArgs h) -> TlsArgs -> XmppTlsArgs h data XmppArgs h XmppArgs :: [ByteString] -> Jid -> ByteString -> Jid -> (XmlNode -> Bool) -> (XmlNode -> Bool) -> XmppArgs h mechanisms :: XmppArgs h -> [ByteString] myJid :: XmppArgs h -> Jid passowrd :: XmppArgs h -> ByteString yourJid :: XmppArgs h -> Jid iNeedResponse :: XmppArgs h -> XmlNode -> Bool youNeedResponse :: XmppArgs h -> XmlNode -> Bool data TlsArgs TlsArgs :: String -> Bool -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgs serverName :: TlsArgs -> String checkServerName :: TlsArgs -> Bool checkCertificate :: TlsArgs -> XmlNode -> Maybe (SignedCertificate -> Bool) cipherSuites :: TlsArgs -> [CipherSuite] certificateAuthorities :: TlsArgs -> CertificateStore keyChains :: TlsArgs -> [(CertSecretKey, CertificateChain)] instance XmlPusher XmppTls module Network.XmlPush.Xmpp.Server data XmppServer h data XmppServerArgs h XmppServerArgs :: ByteString -> [(ByteString, ByteString)] -> (XmlNode -> Bool) -> (XmlNode -> Bool) -> XmppServerArgs h domainName :: XmppServerArgs h -> ByteString passwords :: XmppServerArgs h -> [(ByteString, ByteString)] iNeedResponse :: XmppServerArgs h -> XmlNode -> Bool youNeedResponse :: XmppServerArgs h -> XmlNode -> Bool instance XmlPusher XmppServer module Network.XmlPush.Xmpp.Tls.Server data XmppTlsServer h data XmppTlsServerArgs h XmppTlsServerArgs :: (XmppServerArgs h) -> TlsArgs -> XmppTlsServerArgs h data XmppServerArgs h XmppServerArgs :: ByteString -> [(ByteString, ByteString)] -> (XmlNode -> Bool) -> (XmlNode -> Bool) -> XmppServerArgs h domainName :: XmppServerArgs h -> ByteString passwords :: XmppServerArgs h -> [(ByteString, ByteString)] iNeedResponse :: XmppServerArgs h -> XmlNode -> Bool youNeedResponse :: XmppServerArgs h -> XmlNode -> Bool data TlsArgs TlsArgs :: (XmlNode -> Maybe String) -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> Maybe CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgs getClientName :: TlsArgs -> XmlNode -> Maybe String checkCertificate :: TlsArgs -> XmlNode -> Maybe (SignedCertificate -> Bool) cipherSuites :: TlsArgs -> [CipherSuite] certificateAuthorities :: TlsArgs -> Maybe CertificateStore keyChains :: TlsArgs -> [(CertSecretKey, CertificateChain)] instance XmlPusher XmppTlsServer module Network.XmlPush.HttpPull.Client data HttpPullCl h data HttpPullClArgs h HttpPullClArgs :: String -> Int -> FilePath -> (XmlNode -> FilePath) -> HandleMonad h XmlNode -> (XmlNode -> Bool) -> Maybe Int -> (XmlNode -> Maybe Int) -> HttpPullClArgs h hostName :: HttpPullClArgs h -> String portNumber :: HttpPullClArgs h -> Int basePath :: HttpPullClArgs h -> FilePath getPath :: HttpPullClArgs h -> XmlNode -> FilePath poll :: HttpPullClArgs h -> HandleMonad h XmlNode isPending :: HttpPullClArgs h -> XmlNode -> Bool duration :: HttpPullClArgs h -> Maybe Int getDuration :: HttpPullClArgs h -> XmlNode -> Maybe Int instance XmlPusher HttpPullCl module Network.XmlPush.HttpPull.Server data HttpPullSv h data HttpPullSvArgs h HttpPullSvArgs :: (XmlNode -> Bool) -> XmlNode -> (XmlNode -> Bool) -> HttpPullSvArgs h isPoll :: HttpPullSvArgs h -> XmlNode -> Bool noPending :: HttpPullSvArgs h -> XmlNode youNeedResponse :: HttpPullSvArgs h -> XmlNode -> Bool module Network.XmlPush.HttpPull.Tls.Client data HttpPullTlsCl h data HttpPullTlsClArgs h HttpPullTlsClArgs :: (HttpPullClArgs TChanHandle) -> TlsArgs -> HttpPullTlsClArgs h data HttpPullClArgs h HttpPullClArgs :: String -> Int -> FilePath -> (XmlNode -> FilePath) -> HandleMonad h XmlNode -> (XmlNode -> Bool) -> Maybe Int -> (XmlNode -> Maybe Int) -> HttpPullClArgs h hostName :: HttpPullClArgs h -> String portNumber :: HttpPullClArgs h -> Int basePath :: HttpPullClArgs h -> FilePath getPath :: HttpPullClArgs h -> XmlNode -> FilePath poll :: HttpPullClArgs h -> HandleMonad h XmlNode isPending :: HttpPullClArgs h -> XmlNode -> Bool duration :: HttpPullClArgs h -> Maybe Int getDuration :: HttpPullClArgs h -> XmlNode -> Maybe Int data TlsArgs TlsArgs :: String -> Bool -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgs serverName :: TlsArgs -> String checkServerName :: TlsArgs -> Bool checkCertificate :: TlsArgs -> XmlNode -> Maybe (SignedCertificate -> Bool) cipherSuites :: TlsArgs -> [CipherSuite] certificateAuthorities :: TlsArgs -> CertificateStore keyChains :: TlsArgs -> [(CertSecretKey, CertificateChain)] instance HandleLike TChanHandle instance XmlPusher HttpPullTlsCl module Network.XmlPush.HttpPull.Tls.Server data HttpPullTlsSv h data HttpPullTlsSvArgs h HttpPullTlsSvArgs :: (HttpPullSvArgs h) -> TlsArgs -> HttpPullTlsSvArgs h data HttpPullSvArgs h HttpPullSvArgs :: (XmlNode -> Bool) -> XmlNode -> (XmlNode -> Bool) -> HttpPullSvArgs h isPoll :: HttpPullSvArgs h -> XmlNode -> Bool noPending :: HttpPullSvArgs h -> XmlNode youNeedResponse :: HttpPullSvArgs h -> XmlNode -> Bool data TlsArgs TlsArgs :: (XmlNode -> Maybe String) -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> Maybe CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgs getClientName :: TlsArgs -> XmlNode -> Maybe String checkCertificate :: TlsArgs -> XmlNode -> Maybe (SignedCertificate -> Bool) cipherSuites :: TlsArgs -> [CipherSuite] certificateAuthorities :: TlsArgs -> Maybe CertificateStore keyChains :: TlsArgs -> [(CertSecretKey, CertificateChain)] module Network.XmlPush.HttpPush data HttpPush h data HttpPushArgs h HttpPushArgs :: (XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath)) -> Maybe (HandleMonad h h) -> Maybe (String, Int, FilePath) -> (XmlNode -> FilePath) -> (XmlNode -> Bool) -> HttpPushArgs h getClient :: HttpPushArgs h -> XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath) getServer :: HttpPushArgs h -> Maybe (HandleMonad h h) hostName :: HttpPushArgs h -> Maybe (String, Int, FilePath) getPath :: HttpPushArgs h -> XmlNode -> FilePath youNeedResponse :: HttpPushArgs h -> XmlNode -> Bool module Network.XmlPush.HttpPush.Tls data HttpPushTls h data HttpPushTlsArgs h HttpPushTlsArgs :: (HttpPushArgs h) -> TlsArgs -> TlsArgs -> HttpPushTlsArgs h data HttpPushArgs h HttpPushArgs :: (XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath)) -> Maybe (HandleMonad h h) -> Maybe (String, Int, FilePath) -> (XmlNode -> FilePath) -> (XmlNode -> Bool) -> HttpPushArgs h getClient :: HttpPushArgs h -> XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath) getServer :: HttpPushArgs h -> Maybe (HandleMonad h h) hostName :: HttpPushArgs h -> Maybe (String, Int, FilePath) getPath :: HttpPushArgs h -> XmlNode -> FilePath youNeedResponse :: HttpPushArgs h -> XmlNode -> Bool type TlsArgsCl = TlsArgs tlsArgsCl :: String -> Bool -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgsCl type TlsArgsSv = TlsArgs tlsArgsSv :: (XmlNode -> Maybe String) -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> Maybe CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgsSv module Network.XmlPush.Http.Server data HttpSv h data HttpSvArgs h HttpSvArgs :: (XmlNode -> Mechanism) -> (HttpPullSvArgs h) -> (HttpPushArgs h) -> HttpSvArgs h data Mechanism Pull :: Mechanism Push :: Mechanism data HttpPullSvArgs h HttpPullSvArgs :: (XmlNode -> Bool) -> XmlNode -> (XmlNode -> Bool) -> HttpPullSvArgs h data HttpPushArgs h HttpPushArgs :: (XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath)) -> Maybe (HandleMonad h h) -> Maybe (String, Int, FilePath) -> (XmlNode -> FilePath) -> (XmlNode -> Bool) -> HttpPushArgs h instance Show Mechanism instance XmlPusher HttpSv module Network.XmlPush.Http.Tls.Server data HttpTlsSv h data HttpTlsSvArgs h HttpTlsSvArgs :: (XmlNode -> Mechanism) -> (HttpPullSvArgs h) -> (HttpPushArgs h) -> TlsArgs -> TlsArgs -> HttpTlsSvArgs h data Mechanism Pull :: Mechanism Push :: Mechanism data HttpPullTlsSvArgs h HttpPullTlsSvArgs :: (HttpPullSvArgs h) -> TlsArgs -> HttpPullTlsSvArgs h data HttpPullSvArgs h HttpPullSvArgs :: (XmlNode -> Bool) -> XmlNode -> (XmlNode -> Bool) -> HttpPullSvArgs h data HttpPushTlsArgs h HttpPushTlsArgs :: (HttpPushArgs h) -> TlsArgs -> TlsArgs -> HttpPushTlsArgs h data HttpPushArgs h HttpPushArgs :: (XmlNode -> Maybe (HandleMonad h h, String, Int, FilePath)) -> Maybe (HandleMonad h h) -> Maybe (String, Int, FilePath) -> (XmlNode -> FilePath) -> (XmlNode -> Bool) -> HttpPushArgs h type TlsArgsCl = TlsArgs tlsArgsCl :: String -> Bool -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgsCl type TlsArgsSv = TlsArgs tlsArgsSv :: (XmlNode -> Maybe String) -> (XmlNode -> Maybe (SignedCertificate -> Bool)) -> [CipherSuite] -> Maybe CertificateStore -> [(CertSecretKey, CertificateChain)] -> TlsArgsSv instance Show Mechanism instance XmlPusher HttpTlsSv