Sha256: f3afe36123d5e4ee6af2bf2441ee114c4a0b18d90a4e1467c4e77679644ec5f8
Contents?: true
Size: 739 Bytes
Versions: 12
Compression:
Stored size: 739 Bytes
Contents
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Poltergeist.Connection = (function() { function Connection(owner, port) { this.owner = owner; this.port = port; this.commandReceived = __bind(this.commandReceived, this); this.socket = new WebSocket("ws://127.0.0.1:" + this.port + "/"); this.socket.onmessage = this.commandReceived; this.socket.onclose = function() { return phantom.exit(); }; } Connection.prototype.commandReceived = function(message) { return this.owner.runCommand(JSON.parse(message.data)); }; Connection.prototype.send = function(message) { return this.socket.send(JSON.stringify(message)); }; return Connection; })();
Version data entries
12 entries across 12 versions & 3 rubygems