Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding the querystring module (closing #6) and added http client with…

… port 80 only
  • Loading branch information...
commit aeac9368e0c61a49fb6ac0a3696d26b45a7c0bf7 1 parent 6544916
Matthew Francis-Landau authored December 12, 2010
5  sandbox/box/http.js
@@ -9,6 +9,11 @@ exports.createServer = function (fun) {
9 9
     return new Server(fun);
10 10
 };
11 11
 
  12
+exports.createClient = function (port, host) {
  13
+    // port is locked to be 80 all the time
  14
+    return require('_http_client').create(host);
  15
+};
  16
+
12 17
 exports.STATUS_CODES = {
13 18
   100 : 'Continue',
14 19
   101 : 'Switching Protocols',
14  sandbox/modules.js
@@ -38,6 +38,20 @@ exports.crypto = function (context) {
38 38
     return copy(require('crypto'));
39 39
 };
40 40
 
  41
+exports.querystring = function (context) {
  42
+    return copy(require('querystring'));
  43
+};
  44
+
  45
+var _http_client;
  46
+exports._http_client = function (context) {
  47
+    _http_client = _http_client || require('http');
  48
+    return {
  49
+	create: function (host) {
  50
+	    _http_client.createClient(80, host);
  51
+	}
  52
+    };
  53
+};
  54
+
41 55
 exports.util = exports.sys = function (context) {
42 56
     function nothing () {}
43 57
     return {

0 notes on commit aeac936

Please sign in to comment.
Something went wrong with that request. Please try again.