API Docs for: 0.0.9
Show:

Host Class

Defined in: lib/dalek/host.js:45
Module: Dalek

Remote Dalek host proxy

Methods

_createServer

(
  • request
  • response
)
private chainable

Dispatches all incoming requests, possible endpoints local webdriver server, browser launcher, browser shutdown handler

Parameters:

  • request Object

    Request from the dalek remote caller

  • response Object

    Response to the dalek remote caller

_extractBrowser

(
  • url
)
String private

Extracts the browser that should be launched from the launch url request

Parameters:

  • url String

    Url to parse

Returns:

String:

Extracted browser

_generateProxyRequestOptions

(
  • header
  • method
  • url
)
Object private

Generates the request options from the incoming request that should then be forwared to the local webdriver server

Parameters:

  • header Object

    Header meta data

  • method String

    HTTP method

  • url String

    Webriver server endpoint url

Returns:

Object:

Request options

_getLocalIp

() String private

Gets the local ip address (should be the IPv4 address where the runner is accessible from)

Returns:

String:

Local IP address

_grepIp

() private chainable

Tries to find the local IP address

_launcher

(
  • request
  • response
)
private chainable

Launches the local browser

Parameters:

  • request Object

    Request from the dalek remote caller

  • response Object

    Response to the dalek remote caller

_launcher

(
  • response
)
private chainable

Shuts the local browser down, end the otherwise hanging request

Parameters:

  • response Object

    Response to the dalek remote caller

_loadBrowserModule

(
  • browser
  • response
)
Object private

Requires the local browser module & returns it

Parameters:

  • browser String

    Name of the browser to load

  • response Object

    Response to the dalek remote caller

Returns:

Object:

The local browser module

_onBrowserLaunch

(
  • browser
  • response
)
private chainable

Stores network data from the local browser instance, sends browser specific data to the client

Parameters:

  • browser String

    Name of the browser to load

  • response Object

    Response to the dalek remote caller

_onProxyRequest

(
  • request
  • response
  • res
)
private chainable

Proxies remote data to the webdriver server

Parameters:

  • request Object

    Request from the dalek remote caller

  • response Object

    Response to the dalek remote caller

  • res Object

    Response to the local webdriver server

_onProxyRequest

(
  • request
  • response
  • res
  • chunks
)
private chainable

Handles data exchange between the client and the local webdriver server

Parameters:

  • request Object

    Request from the dalek remote caller

  • response Object

    Response to the dalek remote caller

  • res Object

    Response to the local webdriver server

  • chunks Array

    Array of received data pieces that should be forwarded to the local webdriver server

_onRequestDataChunk

(
  • chunk
)
private chainable

Proxies data from the local webdriver server to the client

Parameters:

  • chunk Buffer

    Chunk of the incoming request data

kill

() Object

Shutdown the proxy server

Returns:

Object:

Promise

run

(
  • opts
)
chainable

Starts the remote proxy server, prepares the config

Parameters:

  • opts Object

    Configuration options

Properties

bro

Object

Instance of the local browser

Default: null

config

Dalek.Config

Instance of the dalek config

Default: null

configuration

Object

Local configuration

Default: {}

defaultPort

Integer

Default port that the Dalek remote server is linking against

Default: 9020

proxyRequest

http.IncomingMessage

Incoming message that needs to be proxied to the local webdriver server

Default: null

remoteHost

String

Host address of the called webdriver server

Default: null

remoteId

String

Identifier of the remote client

Default: null

remotePath

String

Path of the webdriver server endpoint

Default: null

remotePort

String

Port of the called webdriver server

Default: null

remoteSecret

String

Secret that got emitted by the remote instance

Default: null

reporterEvents

EventEmitter2

Instance of the reporter event emitter

Default: null

secret

String

Secret that is stored in the local instance

Default: null