Permalink
Browse files

Allow to connect to different BrowserStack compatible API servers.

  • Loading branch information...
1 parent c686d7e commit 8bed5135d58737e58566616875e2b95e687b7721 @daffl daffl committed with Nov 14, 2012
Showing with 8 additions and 2 deletions.
  1. +7 −2 lib/browserstack.js
  2. +1 −0 readme.md
View
@@ -30,6 +30,11 @@ function Client( settings ) {
extend( this, settings );
this.authHeader = "Basic " +
new Buffer( this.username + ":" + this.password ).toString( "base64" );
+
+ this.server = extend({
+ host: "api.browserstack.com",
+ port: 80
+ }, this.server || {});
}
@@ -142,8 +147,8 @@ extend( Client.prototype, {
fn = fn || function() {};
var req = http.request( extend({
- host: "api.browserstack.com",
- port: 80,
+ host: this.server.host,
+ port: this.server.port,
method: "GET",
headers: {
authorization: this.authHeader,
View
@@ -55,6 +55,7 @@ Creates a new client instance.
* `username`: The username for the BrowserStack account.
* `password`: The password for the BrowserStack account.
* `version` (optional; default: `2`): Which version of the BrowserStack API to use.
+ * `server` (optional; default: `{ host: "api.browserstack.com", port: 80 }`): An object containing `host` and `port` to connect to a different BrowserStack API compatible service.
### client.getBrowsers( callback )

0 comments on commit 8bed513

Please sign in to comment.