seaport-proxy

Seaport in the browser!

seaport-proxy

Seaport in the browser!

var boot = require("boot")
    , mdm = boot("/boot")
    , seaport = require("seaport-proxy")
    , ports = seaport(mdm)
 
var stream = ports.get("magic@1.2.x")
stream.on("data", console.log.bind(console, "[BROWSER]"))
 
stream.write("hello from browser!")
var boot = require("boot")
    , Router = require("routes").Router
    , seaport = require("seaport-proxy")
 
var ports = seaport.connect("localhost", 9093)
 
var sock = boot(ports)
sock.install(someHttpServer, '/boot')
console.log("sock hooked on", "/boot")
var seaport = require("seaport")
    , net = require("net")
 
var ports = seaport.connect("localhost", 9093)
 
ports.service("magic@1.2.3", createMagic)
 
function createMagic(portdone) {
    var server = net.createServer(function (stream) {
        stream.write("hello from magic!")
        stream.on("data", function (data) {
            console.log("[MAGIC]", data.toString())
        })
    })
    server.listen(port, done)
    console.log("magic service hooked on port", port)
}

npm install seaport-proxy

  • Raynos