Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… port 80 only
  • Loading branch information...
commit aeac9368e0c61a49fb6ac0a3696d26b45a7c0bf7 1 parent 6544916
@matthewfl authored
Showing with 19 additions and 0 deletions.
  1. +5 −0 sandbox/box/http.js
  2. +14 −0 sandbox/modules.js
View
5 sandbox/box/http.js
@@ -9,6 +9,11 @@ exports.createServer = function (fun) {
return new Server(fun);
};
+exports.createClient = function (port, host) {
+ // port is locked to be 80 all the time
+ return require('_http_client').create(host);
+};
+
exports.STATUS_CODES = {
100 : 'Continue',
101 : 'Switching Protocols',
View
14 sandbox/modules.js
@@ -38,6 +38,20 @@ exports.crypto = function (context) {
return copy(require('crypto'));
};
+exports.querystring = function (context) {
+ return copy(require('querystring'));
+};
+
+var _http_client;
+exports._http_client = function (context) {
+ _http_client = _http_client || require('http');
+ return {
+ create: function (host) {
+ _http_client.createClient(80, host);
+ }
+ };
+};
+
exports.util = exports.sys = function (context) {
function nothing () {}
return {
Please sign in to comment.
Something went wrong with that request. Please try again.