Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

really simple raw png dump of hard-coded rfb

  • Loading branch information...
commit 4e08cf69514417b3642a016b01db01cd65f6f2f7 1 parent 150ca43
@substack substack authored
Showing with 62 additions and 0 deletions.
  1. +3 −0  LICENSE
  2. +29 −0 Main.hs
  3. +4 −0 Setup.hs
  4. +26 −0 virtual-beanstalk.cabal
View
3  LICENSE
@@ -0,0 +1,3 @@
+This software is released under the GNU Affero General Public License version 3
+(AGPLv3), or any later version.
+See http://www.gnu.org/licenses/agpl-3.0.txt
View
29 Main.hs
@@ -0,0 +1,29 @@
+module Main where
+
+import Network.RFB
+import Control.Monad
+import qualified Graphics.GD as GD
+import Network (PortID(PortNumber))
+import Control.Applicative ((<$>))
+
+import Hack
+import Hack.Handler.Happstack
+import Data.ByteString (unpack)
+import Data.ByteString.Lazy (pack)
+import Data.Word
+
+app :: Application
+app = \env -> do
+ rfb <- connect' "localhost" $ PortNumber 5900
+ update <- getUpdate rfb
+ mapM_ (render rfb) $ fbuRectangles update
+ pngData <- pack . unpack
+ <$> (GD.savePngByteString $ fbImage $ rfbFB rfb)
+
+ return $ Response {
+ status = 200,
+ headers = [ ("Content-Type", "image/png") ],
+ body = pngData
+ }
+
+main = run app
View
4 Setup.hs
@@ -0,0 +1,4 @@
+#!/usr/bin/env runhaskell
+
+import Distribution.Simple
+main = defaultMain
View
26 virtual-beanstalk.cabal
@@ -0,0 +1,26 @@
+name: virtual-beanstalk
+version: 0.1.0
+homepage: http://github.com/substack/virtual-beanstalk
+synopsis: Configure, network, and interact with virtual machines entirely
+ over the web
+description:
+ Virtual Beanstalk is a web-based virtual machine manager where users can
+ * interact directly with the graphical or text console
+ * drop virtual machines into a virtual network diagram
+ * access files on the virtual machine directly
+ * create, duplicate, snapshot, and share virtual machine images
+ * integrate non-virtual servers into the virtual network
+
+ Virtual Beanstalk is released under the AGPLv3.
+
+license: OtherLicense
+license-file: LICENSE
+author: James Halliday
+maintainer: substack@gmail.com
+cabal-version: >= 1.2
+build-type: Simple
+
+executable beanstalk
+ main-is: Main.hs
+ Build-Depends: base, bytestring >= 0.9.1.5, hack, network,
+ hack-handler-happstack, gd, network-rfb
Please sign in to comment.
Something went wrong with that request. Please try again.