http-auth
Advanced tools
Comparing version 2.3.2 to 2.3.3
@@ -16,5 +16,5 @@ // HTTP module | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}).listen(1337); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}).listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); |
@@ -14,5 +14,6 @@ // HTTP module | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}).listen(1337); | ||
}).listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); |
@@ -28,5 +28,5 @@ // Using CoffeeScript, needed for utility module. | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}).listen(1337); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}).listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); |
@@ -14,5 +14,5 @@ // HTTP module | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}).listen(1337); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}).listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); |
@@ -21,5 +21,5 @@ // Express module. | ||
// Start server. | ||
app.listen(1337); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
app.listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); |
@@ -23,5 +23,5 @@ // HTTPS module | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}).listen(1337); | ||
// Log URL. | ||
console.log("Server running at https://127.0.0.1:1337/"); | ||
}).listen(1337, function () { | ||
// Log URL. | ||
console.log("Server running at https://127.0.0.1:1337/"); | ||
}); |
@@ -20,8 +20,8 @@ // HTTP module. | ||
res.end("Request successfully proxied!"); | ||
}).listen(1338); | ||
}).listen(1338, function () { | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
}); | ||
// Log URL. | ||
console.log("Server running at http://127.0.0.1:1337/"); | ||
// You can test proxy authentication using curl. | ||
// $ curl -x 127.0.0.1:1337 127.0.0.1:1337 -U gevorg |
@@ -20,2 +20,5 @@ // Generated by CoffeeScript 1.8.0 | ||
return require('./server/connect')(authentication); | ||
}, | ||
passport: function(authentication) { | ||
return require('./server/passport')(authentication); | ||
} | ||
@@ -22,0 +25,0 @@ }; |
{ | ||
"name": "http-auth", | ||
"description": "Node.js package for HTTP basic and digest access authentication.", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"author": "Gevorg Harutyunyan (http://github.com/gevorg)", | ||
@@ -37,3 +37,4 @@ "maintainers": [ | ||
"http-proxy": "1.11.1", | ||
"request": "2.69.0" | ||
"request": "2.69.0", | ||
"passport": "0.3.2" | ||
}, | ||
@@ -40,0 +41,0 @@ "engines": { |
@@ -94,2 +94,27 @@ # http-auth | ||
## [passport](http://passportjs.org/) integration | ||
```javascript | ||
// Authentication module. | ||
var auth = require('http-auth'); | ||
var basic = auth.basic({ | ||
realm: "Simon Area.", | ||
file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass ... | ||
}); | ||
// Application setup. | ||
var app = express(); | ||
// Setup strategy. | ||
var passport = require('passport'); | ||
passport.use(auth.passport(basic)); | ||
// Setup passport. | ||
app.use(passport.initialize()); | ||
// Setup route. | ||
app.get('/', passport.authenticate('http', { session: false }), function(req, res) { | ||
res.end("Welcome to private area - " + req.user + "!"); | ||
}); | ||
``` | ||
## [http-proxy](https://github.com/nodejitsu/node-http-proxy/) integration | ||
@@ -163,2 +188,3 @@ ```javascript | ||
- **[request](https://github.com/request/request/)** - Simplified HTTP request client. | ||
- **[passport](http://passportjs.org/)** - Simple, unobtrusive authentication for Node.js. | ||
@@ -165,0 +191,0 @@ ## License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69763
50
652
211
6