diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+Version 2, December 2004
+
+Copyright (C) 2011 koral <koral at mailoo dot org>
+
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+
+DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
--- /dev/null
+++ b/src/Main.hs
@@ -0,0 +1,96 @@
+module Main where
+
+import Control.Applicative
+import Control.Monad (forever, when)
+import Data.Function (fix)
+import System.Environment
+import System.ZMQ
+import Data.ByteString.Char8 (pack, unpack)
+import Data.ByteString.UTF8 (fromString)
+
+
+main :: IO ()
+main = withContext 1 $ \context -> do  
+    args <- getArgs
+    case args of
+        ["-h"] -> quickHelp
+
+        ["-req", socketName, message] ->  
+            withSocket context Req $ \socket -> do
+                connect socket socketName
+                send socket (pack message) []                
+                reply <- receive socket []
+                putStrLn $ unpack reply
+
+        ["-reqi", socketName] ->
+            withSocket context Req $ \socket -> do
+                connect socket socketName
+                forever $ do
+                    line <- fromString <$> getLine
+                    send socket line []
+                    reply <- receive socket []
+                    putStrLn $ unpack reply
+
+        ["-rep", socketName, defaultResponse] -> 
+            withSocket context Rep $ \socket -> do
+                bind socket socketName 
+                forever $ do
+                    message <- receive socket []
+                    putStrLn $ unpack message
+                    send socket (pack defaultResponse) []
+
+        ["-rbrok", frontendSocket, backendSocket] -> 
+            withSocket context Xrep $ \frontend -> 
+                withSocket context Xreq $ \backend -> do
+                    bind frontend frontendSocket
+                    bind backend  backendSocket 
+                    device Queue frontend backend
+
+        ["-sub", socketName, filter] ->
+            withSocket context Sub $ \socket -> do
+                connect socket socketName
+                subscribe socket filter
+                forever $ do
+                    message <- receive socket []
+                    putStrLn $ unpack message
+
+        ["-pub", socketName] -> 
+            withSocket context Pub $ \socket -> do
+                bind socket socketName
+                forever $ do
+                    line <- fromString <$> getLine
+                    send socket line []
+
+        ["-proxy", frontendSocket, backendSocket, filter] -> 
+            withSocket context Sub $ \frontend -> 
+                withSocket context Pub $ \backend -> do
+                    connect frontend frontendSocket
+                    subscribe frontend filter 
+                    bind backend backendSocket
+                    forever $ proxy frontend backend
+                
+        _ -> do
+            putStrLn "Wrong arguments given."
+            quickHelp
+            
+            
+            return ()
+
+quickHelp :: IO ()
+quickHelp = do
+    putStrLn "Usage: zmqat [-req|-reqi-rep|-rbrok|-sub--pub|-proxy] [OPTIONS]"
+    putStrLn ""
+    putStrLn "\"-req SOCKET_URI MESSAGE\" : send a single MESSAGE to the given responder SOCKET_URI."
+    putStrLn "\"-reqi SOCKET_URI\" : connect to responder SOCKET_URI and prompt interactively the user for messages to send."
+    putStrLn "\"-rep SOCKET_URI DEFAULT_RESPONSE\" : listen to requests at SOCKET_URI and send DEFAULT_RESPONSE to requesters."
+    putStrLn "\"-rbrok FRONTEND_SOCKET_URI BACKEND_SOCKET_URI\" : forward all requests received from FRONTEND_SOCKET_URI to BACKEND_SOCKET_URI. Doesn't seem to work for now."
+    putStrLn "\"-sub SOCKET_URI FILTER\" : connect to a publisher SOCKET_URI and print every published message that matches the FILTER."
+    putStrLn "\"-pub SOCKET_URI\" : prompt interactively the user for messages to publish at socket SOCKET_URI"
+    putStrLn "\"-proxy FRONTEND_SOCKET_URI BACKEND_SOCKET_URI FILTER\" : forward all published messages from BACKEND_SOCKET_URI to FRONTEND_SOCKET_URI while filtering them with FILTER."
+
+
+proxy from to = fix $ \loop -> do
+    message <- receive from []
+    more <- moreToReceive from 
+    send to message [SndMore | more]
+    when more loop
diff --git a/zmqat.cabal b/zmqat.cabal
new file mode 100644
--- /dev/null
+++ b/zmqat.cabal
@@ -0,0 +1,37 @@
+Name:                zmqat
+Version:             0.1.0
+Synopsis:            A socat-like tool for zeromq socket library
+-- Description:         
+-- Homepage:
+Stability:           alpha
+
+License:             OtherLicense
+License-file:        LICENSE
+-- Copyright:           
+Author:              koral
+Maintainer:          koral at mailoo dot org
+
+Category:            Network
+
+-- Extra files to be distributed with the package, such as examples or
+-- a README.
+-- Extra-source-files:  
+
+Cabal-version:       >=1.6
+Build-type:          Simple
+
+
+Source-repository head
+    Type:     git
+    Location: git@twyk.tk/zmqat.git
+
+Executable zmqat
+    Build-depends: 
+        base == 4.*,
+        zeromq-haskell,
+        bytestring,
+        utf8-string
+    Main-is: Main.hs
+    Hs-Source-Dirs: src  
+    Ghc-options: -Wall -threaded 
+
