diff --git a/README.md b/README.md index e793446..6c33609 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,15 @@ A valid (read: that follows this abstraction) stream muxer, must implement the f ### Attach muxer to a transport -- `Node.js` muxer.attach(transport, function (err, conn)) -- `Go` conn, err := muxer.Attach(transport) +- `Node.js` muxer.attach(transport, isListener, function (err, conn)) +- `Go` conn, err := muxer.Attach(transport, isListener) This method attaches our stream muxer to the desired transport (UDP, TCP) and returns/callbacks with the `err, conn`(error, connection). If `err` is passed, no operation should be made in `conn`. +`isListener` is a bool that tells the side of the socket we are, `isListener = true` for listener/server and `isListener = false` for dialer/client side. + `conn` abstracts our established Connection with the other endpoint, it must offer an interface to open a stream inside this connection and to receive incomming stream requests. ### Dial(open/create) a new stream diff --git a/package.json b/package.json new file mode 100644 index 0000000..4f399fa --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "abstract-stream-muxer", + "version": "0.0.0", + "description": "A test suite and interface you can use to implement a stream muxer.", + "main": "src/index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/diasdavid/abstract-stream-muxer.git" + }, + "keywords": [ + "Streams", + "Muxer", + "Abstract", + "Interface" + ], + "author": "David Dias ", + "license": "MIT", + "bugs": { + "url": "https://github.com/diasdavid/abstract-stream-muxer/issues" + }, + "homepage": "https://github.com/diasdavid/abstract-stream-muxer" +}