Skip to content

Commit

Permalink
user real user & pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Aug 24, 2012
1 parent 4697311 commit 1e2304e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions README.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions example/backwards.js
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions example/forward.js
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -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)

Expand Down

0 comments on commit 1e2304e

Please sign in to comment.