Permalink
Browse files

user real user & pass

  • Loading branch information...
1 parent 4697311 commit 1e2304e1539698a6e8528dcb1609aaca6c19f66c @Raynos committed Aug 24, 2012
Showing with 6 additions and 12 deletions.
  1. +1 −7 README.md
  2. +2 −2 example/backwards.js
  3. +2 −2 example/forward.js
  4. +1 −1 index.js
View
@@ -30,19 +30,13 @@ net.createServer(function (stream) {
var Auth = require("auth-stream")
, net = require("net")
-var stream = net.connect(8080)
- , auth = Auth()
-
-stream.pipe(auth).pipe(stream)
+var stream = Auth("steve", "jones", net.connect(8080))
stream.on("data", function (data) {
console.log("[CLIENT]", data)
})
stream.write("anything")
-
-// login(user, pass)
-auth.login("steve", "jones")
```
## Installation
@@ -13,8 +13,8 @@ var server = net.createServer(function (stream) {
})
stream.write("anything")
-}).listen(8080, function () {
- var stream = net.connect(8080)
+}).listen(process.argv[2] || 8080, function () {
+ var stream = net.connect(process.argv[2] || 8080)
var secret = through(function (data) {
console.log("[CLIENT]", data.toString())
View
@@ -18,8 +18,8 @@ var server = net.createServer(function (stream) {
})
stream.pipe(auth).pipe(stream)
-}).listen(8080, function () {
- var stream = Auth("steve", "jones", net.connect(8080))
+}).listen(process.argv[2] || 8080, function () {
+ var stream = Auth("steve", "jones", net.connect(process.argv[2] || 8080))
stream.on("data", function (data) {
console.log("[CLIENT]", data.toString())
View
@@ -14,7 +14,7 @@ function Auth(first, second, third) {
function AuthClient(user, pass, stream) {
var auth = BufferStream().buffer()
- stream.write("steve:jones")
+ stream.write(user + ":" + pass)
stream.on("data", isOpen)

0 comments on commit 1e2304e

Please sign in to comment.