@live-change/dao-websocket 0.5.22 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/index.js +5 -4
- package/lib/WebSocketConnection.js +6 -6
- package/lib/WebSocketServerConnection.js +2 -2
- package/package.json +8 -7
- package/tests/connection.js +7 -8
- package/browser.js +0 -3
package/LICENSE.md
CHANGED
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import WebSocketConnection from "./lib/WebSocketConnection.js"
|
|
2
|
+
import WebSocketServerConnection from "./lib/WebSocketServerConnection.js"
|
|
3
|
+
|
|
4
|
+
export { WebSocketConnection, WebSocketServerConnection }
|
|
5
|
+
export { WebSocketConnection as client, WebSocketServerConnection as server }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const debug =
|
|
1
|
+
import WebSocket from 'universal-websocket-client'
|
|
2
|
+
import { ReactiveConnection } from '@live-change/dao'
|
|
3
|
+
import Debug from 'debug'
|
|
4
|
+
const debug = Debug('reactive-dao-ws')
|
|
5
5
|
|
|
6
|
-
class WebSocketConnection extends
|
|
6
|
+
class WebSocketConnection extends ReactiveConnection {
|
|
7
7
|
constructor(credentials, url, settings) {
|
|
8
8
|
super(credentials, settings)
|
|
9
9
|
this.url = url
|
|
@@ -69,4 +69,4 @@ class WebSocketConnection extends Connection {
|
|
|
69
69
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
export default WebSocketConnection
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import EventEmitter from 'events'
|
|
2
2
|
|
|
3
3
|
class WebSocketServerConnection extends EventEmitter {
|
|
4
4
|
constructor(request, origin) {
|
|
@@ -26,4 +26,4 @@ class WebSocketServerConnection extends EventEmitter {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
export default WebSocketServerConnection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/dao-websocket",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "m8@em8.pl",
|
|
6
6
|
"name": "Michał Łaszczewski",
|
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
"url": "https://github.com/live-change/live-change-dao/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@live-change/dao": "^0.
|
|
13
|
+
"@live-change/dao": "^0.6.0",
|
|
14
14
|
"bufferutil": "^4.0.3",
|
|
15
15
|
"debug": "^4.3.4",
|
|
16
|
-
"supports-color": "^
|
|
16
|
+
"supports-color": "^9.4.0",
|
|
17
17
|
"universal-websocket-client": "^1.0.1",
|
|
18
18
|
"utf-8-validate": "^5.0.4",
|
|
19
19
|
"websocket": "^1.0.34"
|
|
20
20
|
},
|
|
21
21
|
"description": "live-change dao websocket transport",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"
|
|
23
|
+
"tape": "^5.7.4"
|
|
24
24
|
},
|
|
25
25
|
"directories": {},
|
|
26
26
|
"homepage": "https://github.com/live-change/live-change-dao",
|
|
27
27
|
"license": "BSD-3-Clause",
|
|
28
28
|
"main": "index.js",
|
|
29
|
-
"
|
|
29
|
+
"type": "module",
|
|
30
30
|
"maintainers": [
|
|
31
31
|
{
|
|
32
32
|
"email": "michal@laszczewski.com",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"url": ""
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"compileTests": "webpack
|
|
42
|
+
"compileTests": "webpack tests/*.js tests-bundle.js",
|
|
43
|
+
"test": "NODE_ENV=test tape tests/*"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "53b8efc8ec7f5c1c4af33077d8fb4a8a5580f1d9"
|
|
45
46
|
}
|
package/tests/connection.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const rdws = require("../index.js")
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import * as testServerDao from '@live-change/dao/tests/testServerDao.js'
|
|
3
|
+
import ReactiveDao from "@live-change/dao"
|
|
4
|
+
import { server as WebSocketConnection } from 'websocket'
|
|
5
|
+
import http from 'http'
|
|
6
|
+
import * as rdws from '../index.js'
|
|
8
7
|
|
|
9
8
|
test("time value", (t) => {
|
|
10
9
|
t.plan(4)
|
|
@@ -28,7 +27,7 @@ test("time value", (t) => {
|
|
|
28
27
|
console.log('Server is listening on port',port);
|
|
29
28
|
})
|
|
30
29
|
|
|
31
|
-
let wsServer = new
|
|
30
|
+
let wsServer = new WebSocketConnection({ httpServer, autoAcceptConnections: false })
|
|
32
31
|
wsServer.on("request",(request) => {
|
|
33
32
|
t.pass("WebSocket request made")
|
|
34
33
|
let serverConnection = new rdws.server(request)
|
package/browser.js
DELETED