]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Interaction.hs
getRemoteAddr and getRemoteAddr'
[Lucu.git] / Network / HTTP / Lucu / Interaction.hs
index 88cded5c339209fc2f1d023a50c28318747ca4fa..29c944e573bf8c41c1fbb2ca2cb00ba500181eab 100644 (file)
@@ -20,7 +20,7 @@ import qualified Data.ByteString.Lazy.Char8 as B
 import           Data.ByteString.Lazy.Char8 (ByteString)
 import qualified Data.Sequence as S
 import           Data.Sequence (Seq)
-import           Network
+import           Network.Socket
 import           Network.HTTP.Lucu.Config
 import           Network.HTTP.Lucu.HttpVersion
 import           Network.HTTP.Lucu.Request
@@ -28,7 +28,7 @@ import           Network.HTTP.Lucu.Response
 
 data Interaction = Interaction {
       itrConfig       :: Config
-    , itrRemoteHost   :: HostName
+    , itrRemoteAddr   :: SockAddr
     , itrResourcePath :: Maybe [String]
     , itrRequest      :: TVar (Maybe Request)
     , itrResponse     :: TVar Response
@@ -82,8 +82,8 @@ defaultPageContentType :: String
 defaultPageContentType = "application/xhtml+xml"
 
 
-newInteraction :: Config -> HostName -> Maybe Request -> IO Interaction
-newInteraction conf host req
+newInteraction :: Config -> SockAddr -> Maybe Request -> IO Interaction
+newInteraction conf addr req
     = do request  <- newTVarIO $ req
          responce <- newTVarIO $ Response {
                        resVersion = HttpVersion 1 1
@@ -117,7 +117,7 @@ newInteraction conf host req
 
          return $ Interaction {
                       itrConfig       = conf
-                    , itrRemoteHost   = host
+                    , itrRemoteAddr   = addr
                     , itrResourcePath = Nothing
                     , itrRequest      = request
                     , itrResponse     = responce