Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

/visit stuff works with local testling-server

  • Loading branch information...
commit 17889531775e08d5ab65681830bb4c3799b1920b 1 parent e047391
@substack authored
Showing with 23 additions and 2 deletions.
  1. +21 −1 lib/testling_visit.js
  2. +2 −1  package.json
View
22 lib/testling_visit.js
@@ -1,3 +1,23 @@
+var request = require('request');
+
module.exports = function (uri, opts, cb) {
- // ...
+ var turi = process.env.TUNNEL;
+ var auth = (function () {
+ var s = process.env.TESTLING_AUTH.split(':');
+ return encodeURIComponent(s[0]) + ':' + encodeURIComponent(s[1]);
+ })();
+
+ var b = opts.browser.replace(/^testling\./, '').split('/');
+ var browser = b[0];
+ var version = opts.version || b[1];
+
+ var uri = 'http://' + auth + '@localhost:8080/visit?'
+ + 'uri=' + encodeURIComponent(uri)
+ + '&browser=' + encodeURIComponent(browser + '/' + version)
+ ;
+ console.log(uri);
+ request(uri, function (err, res, body) {
+ console.log(body);
+ // ...
+ });
};
View
3  package.json
@@ -35,7 +35,8 @@
"browserify" : "~1.13.3",
"shoe" : "~0.0.2",
"event-stream" : "~2.0.4",
- "JSONStream" : "~0.3.0"
+ "JSONStream" : "~0.3.0",
+ "request" : "~2.9.202"
},
"engines" : {
"node" : ">=0.6"
Please sign in to comment.
Something went wrong with that request. Please try again.