Sha256: 91cab4c9c12b98ff0362331995ce86e5488e2d8f9b6b33d7c22c285cdd1fb763

Contents?: true

Size: 348 Bytes

Versions: 38

Compression:

Stored size: 348 Bytes

Contents

class Poltergeist.Connection
  constructor: (@owner, @port) ->
    @socket = new WebSocket "ws://127.0.0.1:#{@port}/"
    @socket.onmessage = this.commandReceived
    @socket.onclose = -> phantom.exit()

  commandReceived: (message) =>
    @owner.runCommand(JSON.parse(message.data))

  send: (message) ->
    @socket.send(JSON.stringify(message))

Version data entries

38 entries across 38 versions & 4 rubygems

Version Path
poltergeist-1.4.1 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.4.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.1.2 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.0.3 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.3.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.1.1 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.2.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.1.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.0.2 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.0.1 lib/capybara/poltergeist/client/connection.coffee
poltergeist-1.0.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.7.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.6.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.5.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.4.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.3.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.2.0 lib/capybara/poltergeist/client/connection.coffee
poltergeist-0.1.0 lib/capybara/poltergeist/client/connection.coffee