Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support UNIX sockets

  • Loading branch information...
commit abebfda7aded4ad99ade0e7472464e07e43c0ce1 1 parent 85a86ca
@kriskowal authored
Showing with 26 additions and 8 deletions.
  1. +4 −0 CHANGES.md
  2. +3 −3 package.json
  3. +19 −5 q-http.js
View
4 CHANGES.md
@@ -1,5 +1,9 @@
<!-- vim:ts=4:sts=4:sw=4:et:tw=60 -->
+# 0.1.14
+
+- Support UNIX socket listen form #3
+
# 0.1.13
- Fix a mistake in handling body length (Sergey Belov)
View
6 package.json
@@ -1,6 +1,6 @@
{
"name": "q-http",
- "version": "0.1.13",
+ "version": "0.1.14",
"description": "Q promise based HTTP client and server interface",
"homepage": "http://github.com/kriskowal/q-http/",
"author": "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
@@ -16,8 +16,8 @@
],
"main": "q-http.js",
"dependencies": {
- "q": "0.8.2",
- "q-io": "0.0.12"
+ "q": "0.8.4",
+ "q-io": "0.0.13"
},
"devDependencies": {
"test": "0.4.1"
View
24 q-http.js
@@ -124,13 +124,11 @@ exports.Server = function (respond) {
* resolve when the server is ready to receive
* connections
*/
- self.listen = function (port, host) {
+ self.listen = function (/*...args*/) {
if (typeof server.port !== "undefined")
return Q.reject(new Error("A server cannot be restarted or " +
"started on a new port"));
- self.port = port >>> 0;
- self.host = '' + host;
- server.listen(self.port);
+ server.listen.apply(server, arguments);
return listening.promise;
};
@@ -142,6 +140,22 @@ exports.Server = function (respond) {
return self;
};
+Object.defineProperties(exports.Server, {
+
+ port: {
+ get: function () {
+ return this.node.port;
+ }
+ },
+
+ host: {
+ get: function () {
+ return this.node.host;
+ }
+ }
+
+});
+
/**
* A wrapper for a Node HTTP Request, as received by
* the Q HTTP Server, suitable for use by the Q HTTP Client.
@@ -154,7 +168,7 @@ exports.ServerRequest = function (_request) {
request.method = _request.method;
/*** {String} path, starting with `"/"` */
request.path = _request.url;
- /*** {String} pathInfo, starting with `"/"`, the
+ /*** {String} pathInfo, starting with `"/"`, the
* portion of the path that has not yet
* been routed (JSGI) */
request.pathInfo = URL.parse(_request.url).pathname;
Please sign in to comment.
Something went wrong with that request. Please try again.