Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Mar 27, 2017
1 parent 4d6f80f commit 5df2aae
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .crossbar/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "router",
"realms": [
{
"name": "realm1",
"name": "crossbardemo",
"roles": [
{
"name": "anonymous",
Expand Down Expand Up @@ -58,12 +58,15 @@
"port": 8080
},
"rawsocket": {
"serializers": [
"cbor", "msgpack", "ubjson", "json"
]
},
"websocket": {
"ws": {
"type": "websocket",
"serializers": [
"cbor", "msgpack", "json"
"cbor", "msgpack", "ubjson", "json"
],
"options": {
"compression": {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node-v*-linux-x64/
.sconsign.dblite
*.sublime-workspace
build
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ copy_browser: build_browser
publish_npm:
npm publish

crossbar:
crossbar start

test:
npm test

test_connect:
nodeunit test/test_connect.js

test_msgpack_serialization:
nodeunit test/test_msgpack_serialization.js
test_serialization_cbor:
nodeunit test/test_serialization_cbor.js
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,29 @@ AutobahnJS is available via the Node package manager [here](https://www.npmjs.or

#### NodeJS and ws version

AutobahnJS works with both v1 and v2 of the ws library, and you should use the ws version depending on the NodeJS version you use.

If you run NodeJS v4.5.0 or later, you can use the ws library v2:

```console
npm install ws@2`
```

If you run an earlier version of NodeJS, use must use the ws library v1:

```console
npm install ws@1`
```

**Details**

AutobahnJS currently strives for support of NodeJS v4.2.6 or later. The reason is that this is the version that currently ships with Ubuntu 16.04 LTS.

On NodeJS, we need the [ws library](https://github.com/websockets/ws/) for WebSocket support, as different from browsers, NodeJS does not come with a native implementation.

However, the ws library v2 or later is incompatible with NodeJS earlier than v4.5.0. See [here](http://stackoverflow.com/a/42331959/884770) and [here](https://github.com/websockets/ws/issues/989).

Rather than dropping support for NodeJS v4 (and hence for the system NodeJS version of Ubuntu), we use ws v1 for time being.
Rather than dropping support for NodeJS v4 (and hence for the system NodeJS version of Ubuntu), we use ws v1 as a dependency in `package.json`, but allow any version of ws to be used.

## More information

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"cbor": ">= 3.0.0",
"tweetnacl": ">= 0.14.3",
"when": ">= 3.7.7",
"ws": "< 2.0.0"
"ws": ">= 1.1.4"
},
"optionalDependencies": {
"bufferutil": ">= 1.2.1",
Expand Down

0 comments on commit 5df2aae

Please sign in to comment.