summaryrefslogtreecommitdiff
path: root/lib/https.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-01-02 01:13:56 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-01-03 15:51:05 -0800
commit94f8368cf9e5077050525e32a24188402f077074 (patch)
treed9b014c77094dc5d13bc7b42cda1d93fa3c2703d /lib/https.js
parente4dd5cd6fd7b44f4fc21a5cfd39615a7a5833957 (diff)
downloadandroid-node-v8-94f8368cf9e5077050525e32a24188402f077074.tar.gz
android-node-v8-94f8368cf9e5077050525e32a24188402f077074.tar.bz2
android-node-v8-94f8368cf9e5077050525e32a24188402f077074.zip
First pass at new https server
Diffstat (limited to 'lib/https.js')
-rw-r--r--lib/https.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js
new file mode 100644
index 0000000000..c3e17a3602
--- /dev/null
+++ b/lib/https.js
@@ -0,0 +1,22 @@
+var tls = require('tls');
+var http = require('http');
+var inherits = require('util').inherits;
+
+
+function Server(opts, requestListener) {
+ if (!(this instanceof Server)) return new Server(opts, requestListener);
+ tls.Server.call(this, opts, http._connectionListener);
+
+ if (requestListener) {
+ this.addListener('request', requestListener);
+ }
+}
+inherits(Server, tls.Server);
+
+
+exports.Server = Server;
+
+
+exports.createServer = function(opts, requestListener) {
+ return new Server(opts, requestListener);
+};