hsync 0.16.1 → 0.17.0
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/Readme.md +27 -13
- package/cli.js +3 -3
- package/connection.js +11 -0
- package/dist/hsync.js +168 -22
- package/dist/hsync.min.js +1 -1
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -2,27 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://nodei.co/npm/hsync/)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
hsync is a [reverse-proxy](https://en.wikipedia.org/wiki/Reverse_proxy) client for node.js and browsers that connects to an [hsync-server](https://github.com/monteslu/hsync-server).
|
|
6
|
+
|
|
7
|
+
You can share your local webserver as a secure public URL, as well as tunnel whatever tcp/ip traffic you'd like between two hsync clients.
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
## basic usage
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
`npm i`
|
|
12
|
+
## install globally
|
|
13
|
+
`npm i -g hsync`
|
|
14
|
+
|
|
15
|
+
### run
|
|
16
|
+
`hsync`
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
## run with npx
|
|
14
19
|
|
|
20
|
+
`npx hsync`
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
`export HSYNC_SERVER="wss://myhost.myserver.com"`
|
|
22
|
+
## configuration
|
|
18
23
|
|
|
24
|
+
by default hsync will connect to the default hsync.tech server and allow a connection for up to 4 hours.
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
However you can pass flags to the command line or configure env variables:
|
|
27
|
+
|
|
28
|
+
| flag | long flag | type | env variable | description |
|
|
29
|
+
| ---- | --------------------- | ------- | ------------------ | ---------------------------------------------------------- |
|
|
30
|
+
| -p | -port | number | PORT | port for local webserver |
|
|
31
|
+
| -d | --dynamic-host | url | HSYNC_DYNAMIC_HOST | host to get a dynamic connection from |
|
|
32
|
+
| -s | --hsync-server | url | HSYNC_SERVER | hsync-server location ex: wss://sub.mydomain.com |
|
|
33
|
+
| -hs | --hsync-secret | string | HSYNC_SECRET | password to connect to hsync-server |
|
|
34
|
+
| -llp | --listener-local-port | number | HSYNC_LLP | local port to open for listener |
|
|
35
|
+
| -lth | --listener-target-host | url | HSYNC_LTH | target host for listener |
|
|
36
|
+
| -ltp | --listener-target-port | number | HSYNC_LTP | target port for listener |
|
|
37
|
+
| -rip | --relay-inbound-port | number | HSYNC_RIP | inbound port for remote relay requests |
|
|
38
|
+
| -rth | --relay-target-host | url | HSYNC_RTH | target host for relay to open tcp connection on |
|
|
39
|
+
| -rtp | --relay-target-port | number | HSYNC_RTP | target port for relay to open tcp connection on |
|
|
22
40
|
|
|
23
|
-
### local webserver port
|
|
24
|
-
`export PORT="8080"`
|
|
25
41
|
|
|
26
|
-
### run
|
|
27
|
-
`node index`
|
|
28
42
|
|
package/cli.js
CHANGED
|
@@ -16,9 +16,9 @@ program
|
|
|
16
16
|
.addOption(new Option('-llp, --listener-local-port <number>', 'local port to open for listener').env('HSYNC_LLP'))
|
|
17
17
|
.addOption(new Option('-lth, --listener-target-host <url>', 'target host for listener').env('HSYNC_LTH'))
|
|
18
18
|
.addOption(new Option('-ltp, --listener-target-port <number>', 'target port for listener').env('HSYNC_LTP'))
|
|
19
|
-
.addOption(new Option('-rip, --relay-inbound-port <number>', 'inbound port
|
|
20
|
-
.addOption(new Option('-rth, --relay-target-host <
|
|
21
|
-
.addOption(new Option('-rtp, --relay-target-port <number>', 'target port for relay').env('HSYNC_RTP'));
|
|
19
|
+
.addOption(new Option('-rip, --relay-inbound-port <number>', 'inbound port for remote relay requests').env('HSYNC_RIP'))
|
|
20
|
+
.addOption(new Option('-rth, --relay-target-host <url>', 'target host for relay to open tcp connection on').env('HSYNC_RTH'))
|
|
21
|
+
.addOption(new Option('-rtp, --relay-target-port <number>', 'target port for relay to open tcp connection on').env('HSYNC_RTP'));
|
|
22
22
|
|
|
23
23
|
program.parse();
|
|
24
24
|
|
package/connection.js
CHANGED
|
@@ -297,6 +297,17 @@ async function createHsync(config) {
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
if (relayInboundPort) {
|
|
301
|
+
relayInboundPort.forEach((rip, i) => {
|
|
302
|
+
const rth = relayTargetHost ? relayTargetHost[i] : 'localhost';
|
|
303
|
+
if (rth) {
|
|
304
|
+
const rtp = relayTargetPort ? relayTargetPort[i] : rip;
|
|
305
|
+
addSocketRelay(rip, myHostName, rtp, rth);
|
|
306
|
+
console.log('relaying inbound', rip, 'to', rth, rtp);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
|
|
300
311
|
return hsyncClient;
|
|
301
312
|
}
|
|
302
313
|
|
package/dist/hsync.js
CHANGED
|
@@ -25,7 +25,7 @@ eval("let process = __webpack_require__.g.process || {env: {}};\n\nconst baseCon
|
|
|
25
25
|
\***********************/
|
|
26
26
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
27
27
|
|
|
28
|
-
eval("const EventEmitter = (__webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter);\nconst b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:info');\nconst debugVerbose = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:verbose');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\nconst { getRPCPeer, createServerPeer } = __webpack_require__(/*! ./lib/rpc */ \"./lib/rpc.js\");\nconst { createWebHandler, setNet: webSetNet } = __webpack_require__(/*! ./lib/web-handler */ \"./lib/web-handler.js\");\nconst { createSocketListenHandler, setNet: listenSetNet, receiveRelayData } = __webpack_require__(/*! ./lib/socket-listen-handler */ \"./lib/socket-listen-handler.js\");\nconst { createSocketRelayHandler, setNet: relaySetNet, receiveListenerData, connectSocket } = __webpack_require__(/*! ./lib/socket-relay-handler */ \"./lib/socket-relay-handler.js\");\nconst fetch = __webpack_require__(/*! ./lib/fetch */ \"./lib/fetch.js\");\n\ndebug.color = 3;\ndebugVerbose.color = 2;\ndebugError.color = 1;\n\nlet mqtt;\n\nfunction setNet(netImpl) {\n webSetNet(netImpl);\n listenSetNet(netImpl);\n relaySetNet(netImpl);\n}\n\nfunction setMqtt(mqttImpl) {\n mqtt = mqttImpl;\n}\n\nasync function createHsync(config) {\n let {\n hsyncServer,\n hsyncSecret,\n localHost,\n port,\n hsyncBase,\n keepalive,\n dynamicHost,\n } = config;\n\n let dynamicTimeout;\n\n if (dynamicHost) {\n const result = await fetch.post(`${dynamicHost}/${hsyncBase}/dyn`, {});\n if (dynamicHost.toLowerCase().startsWith('https')) {\n hsyncServer = `wss://${result.url}`;\n } else {\n hsyncServer = `ws://${result.url}`;\n }\n hsyncSecret = result.secret;\n dynamicTimeout = result.timeout;\n }\n\n const hsyncClient = {};\n hsyncClient.config = config;\n // const peers = {};\n const socketListeners = {};\n const socketRelays= {};\n const events = new EventEmitter();\n \n hsyncClient.on = events.on;\n hsyncClient.emit = events.emit;\n // hsyncClient.peers = peers;\n \n let lastConnect;\n const connectURL = `${hsyncServer}${hsyncServer.endsWith('/') ? '' : '/'}${hsyncBase}`;\n const myHostName = (new URL(connectURL)).hostname;\n hsyncClient.myHostName = myHostName;\n \n debug('connecting to', connectURL, '…' );\n const mqConn = mqtt.connect(connectURL, { password: hsyncSecret, username: myHostName, keepalive });\n mqConn.myHostName = myHostName;\n hsyncClient.mqConn = mqConn;\n\n const webHandler = config.webHandler || createWebHandler({myHostName, localHost, port, mqConn});\n hsyncClient.webHandler = webHandler;\n\n mqConn.on('connect', () => {\n const now = Date.now();\n debug('connected to', myHostName, lastConnect ? (now - lastConnect) : '', lastConnect ? 'since last connect' : '');\n lastConnect = now;\n hsyncClient.emit('connected', config);\n });\n\n mqConn.on('error', (error) => {\n debugError('error on mqConn', myHostName, error.code, error);\n if ((error.code === 4) || (error.code === 5)) {\n debug('ending');\n mqConn.end();\n }\n });\n\n mqConn.on('message', (topic, message) => {\n if (!topic) {\n return;\n }\n // message is Buffer\n const [name, hostName, segment3, action, segment5] = topic.split('/');\n debugVerbose('\\n↓ MQTT' , topic);\n if (name === 'web') {\n webHandler.handleWebRequest(hostName, segment3, action, message);\n return;\n } else if (name === 'msg') {\n const from = segment3;\n if (action === 'json') {\n try {\n const msg = JSON.parse(message.toString());\n msg.from = from;\n hsyncClient.emit('json', msg);\n } catch (e) {\n debugError('error parsing json message');\n }\n } else if (action === 'rpc') {\n const peer = getRPCPeer({hostName: from, temporary: true, hsyncClient});\n // const peer = getPeer({hostName: from, temporary: true});\n peer.transport.receiveData(message.toString());\n }\n else if (!action && (segment3 === 'srpc')) {\n hsyncClient.serverPeer.transport.receiveData(message.toString());\n }\n else if (action === 'socketData') {\n // events.emit('socketData', from, segment5, message);\n receiveSocketData(segment5, message);\n }\n else if (action === 'relayData') {\n // events.emit('socketData', from, segment5, message);\n receiveRelayData(segment5, message);\n }\n else if (action === 'socketClose') {\n events.emit('socketClose', from, segment5);\n }\n }\n\n });\n\n // function getPeer({hostName, temporary, timeout = 10000}) {\n // let peer = peers[hostName];\n // if (!peer) {\n // peer = createRPCPeer({hostName, hsyncClient, timeout, methods: peerMethods});\n // if (temporary) {\n // peer.rpcTemporary = true;\n // }\n // peers[host] = peer;\n // }\n // return peer;\n // }\n\n function sendJson(host, json) {\n if (!host || !json) {\n return;\n }\n\n if (host === myHostName) {\n debugError('cannot send message to self', host);\n }\n\n if (typeof json === 'object') {\n json = JSON.stringify(json);\n } else if (typeof json === 'string') {\n try {\n json = JSON.stringify(JSON.parse(json));\n } catch(e) {\n debugError('not well formed json or object', e);\n return;\n }\n } else {\n return;\n }\n mqConn.publish(`msg/${host}/${myHostName}/json`, json);\n }\n\n function endClient(force, callback) {\n if (force) {\n mqConn.end(force);\n if (webHandler.end) {\n webHandler.end();\n }\n return;\n }\n mqConn.end(force, (a, b) => {\n if (webHandler.end) {\n webHandler.end();\n }\n if (callback) {\n callback(a, b);\n }\n })\n }\n\n function getSocketListeners () {\n return Object.keys(socketListeners).map((id) => {\n return { info: socketListeners[id].info, id };\n });\n }\n\n function getSocketRelays () {\n return Object.keys(socketRelays).map((id) => {\n return { info: socketRelays[id].info, id };\n });\n }\n\n function addSocketListener (port, hostName, targetPort, targetHost = 'localhost') {\n const handler = createSocketListenHandler({port, hostName, targetPort, targetHost, hsyncClient});\n const id = b64id.generateId();\n socketListeners[id] = {handler, info: {port, hostName, targetPort, targetHost}, id};\n return getSocketListeners();\n }\n\n function addSocketRelay(port, hostName, targetPort, targetHost = 'localhost') {\n const handler = createSocketRelayHandler({port, hostName, targetPort, targetHost, hsyncClient});\n const id = b64id.generateId();\n socketRelays[id] = {handler, info: {port, hostName, targetPort, targetHost}, id};\n debug('relay added', port);\n return getSocketRelays();\n }\n\n const serverReplyMethods = {\n ping: (greeting) => {\n return `${greeting} back atcha from client. ${Date.now()}`;\n },\n addSocketListener,\n getSocketListeners,\n getSocketRelays,\n addSocketRelay,\n peerRpc: async (requestInfo) => {\n requestInfo.hsyncClient = hsyncClient;\n const { msg } = requestInfo;\n debug('peerRpc handler', requestInfo.fromHost, msg);\n const reply = {id: msg.id};\n try {\n if (!peerMethods[msg.method]) {\n const notFoundError = new Error('method not found');\n notFoundError.code = -32601;\n throw notFoundError;\n }\n const result = await peerMethods[msg.method](requestInfo, ...msg.params);\n reply.result = result;\n return result;\n } catch (e) {\n debug('peer rpc error', e, msg);\n msg.error = {\n code: e.code || 500,\n message: e.toString(),\n };\n return msg;\n }\n }\n };\n\n const peerMethods = {\n ping: (host, greeting) => {\n debug('ping called', host, greeting);\n return `${greeting} back atcha, ${host}.`;\n },\n connectSocket,\n receiveListenerData,\n receiveRelayData,\n };\n\n hsyncClient.serverPeer = createServerPeer(hsyncClient, serverReplyMethods);\n\n hsyncClient.hsyncBase = hsyncBase;\n hsyncClient.sendJson = sendJson;\n hsyncClient.endClient = endClient;\n hsyncClient.serverReplyMethods = serverReplyMethods;\n hsyncClient.getRPCPeer = getRPCPeer;\n hsyncClient.peerMethods = peerMethods;\n hsyncClient.hsyncSecret = hsyncSecret;\n hsyncClient.hsyncServer = hsyncServer;\n hsyncClient.dynamicTimeout = dynamicTimeout;\n const { host, protocol } = new URL(hsyncServer);\n debug('url', host, protocol);\n if (protocol === 'wss:') {\n hsyncClient.webUrl = `https://${host}`;\n } else {\n hsyncClient.webUrl = `http://${host}`;\n }\n hsyncClient.webAdmin = `${hsyncClient.webUrl}/${hsyncBase}/admin`;\n hsyncClient.webBase = `${hsyncClient.webUrl}/${hsyncBase}`;\n hsyncClient.port = port;\n\n return hsyncClient;\n}\n\nmodule.exports = {\n createHsync,\n setNet,\n setMqtt,\n};\n\n\n//# sourceURL=webpack://hsync/./connection.js?");
|
|
28
|
+
eval("const EventEmitter = (__webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter);\nconst b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:info');\nconst debugVerbose = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:verbose');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\nconst { getRPCPeer, createServerPeer } = __webpack_require__(/*! ./lib/rpc */ \"./lib/rpc.js\");\nconst { createWebHandler, setNet: webSetNet } = __webpack_require__(/*! ./lib/web-handler */ \"./lib/web-handler.js\");\nconst { createSocketListenHandler, setNet: listenSetNet, receiveRelayData } = __webpack_require__(/*! ./lib/socket-listen-handler */ \"./lib/socket-listen-handler.js\");\nconst { createSocketRelayHandler, setNet: relaySetNet, receiveListenerData, connectSocket } = __webpack_require__(/*! ./lib/socket-relay-handler */ \"./lib/socket-relay-handler.js\");\nconst fetch = __webpack_require__(/*! ./lib/fetch */ \"./lib/fetch.js\");\n\ndebug.color = 3;\ndebugVerbose.color = 2;\ndebugError.color = 1;\n\nlet mqtt;\n\nfunction setNet(netImpl) {\n webSetNet(netImpl);\n listenSetNet(netImpl);\n relaySetNet(netImpl);\n}\n\nfunction setMqtt(mqttImpl) {\n mqtt = mqttImpl;\n}\n\nasync function createHsync(config) {\n let {\n hsyncServer,\n hsyncSecret,\n localHost,\n port,\n hsyncBase,\n keepalive,\n dynamicHost,\n listenerLocalPort,\n listenerTargetHost,\n listenerTargetPort,\n relayInboundPort,\n relayTargetHost,\n relayTargetPort,\n } = config;\n\n // console.log('config', config);\n\n let dynamicTimeout;\n\n if (dynamicHost) {\n const result = await fetch.post(`${dynamicHost}/${hsyncBase}/dyn`, {});\n if (dynamicHost.toLowerCase().startsWith('https')) {\n hsyncServer = `wss://${result.url}`;\n } else {\n hsyncServer = `ws://${result.url}`;\n }\n hsyncSecret = result.secret;\n dynamicTimeout = result.timeout;\n }\n\n const hsyncClient = {};\n hsyncClient.config = config;\n // const peers = {};\n const socketListeners = {};\n const socketRelays= {};\n const events = new EventEmitter();\n \n hsyncClient.on = events.on;\n hsyncClient.emit = events.emit;\n // hsyncClient.peers = peers;\n \n let lastConnect;\n const connectURL = `${hsyncServer}${hsyncServer.endsWith('/') ? '' : '/'}${hsyncBase}`;\n const myHostName = (new URL(connectURL)).hostname;\n hsyncClient.myHostName = myHostName;\n \n debug('connecting to', connectURL, '…' );\n const mqConn = mqtt.connect(connectURL, { password: hsyncSecret, username: myHostName, keepalive });\n mqConn.myHostName = myHostName;\n hsyncClient.mqConn = mqConn;\n\n const webHandler = config.webHandler || createWebHandler({myHostName, localHost, port, mqConn});\n hsyncClient.webHandler = webHandler;\n\n mqConn.on('connect', () => {\n const now = Date.now();\n debug('connected to', myHostName, lastConnect ? (now - lastConnect) : '', lastConnect ? 'since last connect' : '');\n lastConnect = now;\n hsyncClient.emit('connected', config);\n });\n\n mqConn.on('error', (error) => {\n debugError('error on mqConn', myHostName, error.code, error);\n if ((error.code === 4) || (error.code === 5)) {\n debug('ending');\n mqConn.end();\n }\n });\n\n mqConn.on('message', (topic, message) => {\n if (!topic) {\n return;\n }\n // message is Buffer\n const [name, hostName, segment3, action, segment5] = topic.split('/');\n debugVerbose('\\n↓ MQTT' , topic);\n if (name === 'web') {\n webHandler.handleWebRequest(hostName, segment3, action, message);\n return;\n } else if (name === 'msg') {\n const from = segment3;\n if (action === 'json') {\n try {\n const msg = JSON.parse(message.toString());\n msg.from = from;\n hsyncClient.emit('json', msg);\n } catch (e) {\n debugError('error parsing json message');\n }\n } else if (action === 'rpc') {\n const peer = getRPCPeer({hostName: from, temporary: true, hsyncClient});\n // const peer = getPeer({hostName: from, temporary: true});\n peer.transport.receiveData(message.toString());\n }\n else if (!action && (segment3 === 'srpc')) {\n hsyncClient.serverPeer.transport.receiveData(message.toString());\n }\n else if (action === 'socketData') {\n // events.emit('socketData', from, segment5, message);\n receiveSocketData(segment5, message);\n }\n else if (action === 'relayData') {\n // events.emit('socketData', from, segment5, message);\n receiveRelayData(segment5, message);\n }\n else if (action === 'socketClose') {\n events.emit('socketClose', from, segment5);\n }\n }\n\n });\n\n // function getPeer({hostName, temporary, timeout = 10000}) {\n // let peer = peers[hostName];\n // if (!peer) {\n // peer = createRPCPeer({hostName, hsyncClient, timeout, methods: peerMethods});\n // if (temporary) {\n // peer.rpcTemporary = true;\n // }\n // peers[host] = peer;\n // }\n // return peer;\n // }\n\n function sendJson(host, json) {\n if (!host || !json) {\n return;\n }\n\n if (host === myHostName) {\n debugError('cannot send message to self', host);\n }\n\n if (typeof json === 'object') {\n json = JSON.stringify(json);\n } else if (typeof json === 'string') {\n try {\n json = JSON.stringify(JSON.parse(json));\n } catch(e) {\n debugError('not well formed json or object', e);\n return;\n }\n } else {\n return;\n }\n mqConn.publish(`msg/${host}/${myHostName}/json`, json);\n }\n\n function endClient(force, callback) {\n if (force) {\n mqConn.end(force);\n if (webHandler.end) {\n webHandler.end();\n }\n return;\n }\n mqConn.end(force, (a, b) => {\n if (webHandler.end) {\n webHandler.end();\n }\n if (callback) {\n callback(a, b);\n }\n })\n }\n\n function getSocketListeners () {\n return Object.keys(socketListeners).map((id) => {\n return { info: socketListeners[id].info, id };\n });\n }\n\n function getSocketRelays () {\n return Object.keys(socketRelays).map((id) => {\n return { info: socketRelays[id].info, id };\n });\n }\n\n function addSocketListener (port, hostName, targetPort, targetHost) {\n // console.log('addSocketListener', port, hostName, targetPort, targetHost);\n const handler = createSocketListenHandler({port, hostName, targetPort, targetHost, hsyncClient});\n const id = b64id.generateId();\n socketListeners[id] = {handler, info: {port, hostName, targetPort, targetHost}, id};\n return getSocketListeners();\n }\n\n function addSocketRelay(port, hostName, targetPort, targetHost = 'localhost') {\n const handler = createSocketRelayHandler({port, hostName, targetPort, targetHost, hsyncClient});\n const id = b64id.generateId();\n socketRelays[id] = {handler, info: {port, hostName, targetPort, targetHost}, id};\n debug('relay added', port);\n return getSocketRelays();\n }\n\n const serverReplyMethods = {\n ping: (greeting) => {\n return `${greeting} back atcha from client. ${Date.now()}`;\n },\n addSocketListener,\n getSocketListeners,\n getSocketRelays,\n addSocketRelay,\n peerRpc: async (requestInfo) => {\n requestInfo.hsyncClient = hsyncClient;\n const { msg } = requestInfo;\n debug('peerRpc handler', requestInfo.fromHost, msg);\n const reply = {id: msg.id};\n try {\n if (!peerMethods[msg.method]) {\n const notFoundError = new Error('method not found');\n notFoundError.code = -32601;\n throw notFoundError;\n }\n const result = await peerMethods[msg.method](requestInfo, ...msg.params);\n reply.result = result;\n return result;\n } catch (e) {\n debug('peer rpc error', e, msg);\n msg.error = {\n code: e.code || 500,\n message: e.toString(),\n };\n return msg;\n }\n }\n };\n\n const peerMethods = {\n ping: (host, greeting) => {\n debug('ping called', host, greeting);\n return `${greeting} back atcha, ${host}.`;\n },\n connectSocket,\n receiveListenerData,\n receiveRelayData,\n };\n\n hsyncClient.serverPeer = createServerPeer(hsyncClient, serverReplyMethods);\n\n hsyncClient.hsyncBase = hsyncBase;\n hsyncClient.sendJson = sendJson;\n hsyncClient.endClient = endClient;\n hsyncClient.serverReplyMethods = serverReplyMethods;\n hsyncClient.getRPCPeer = getRPCPeer;\n hsyncClient.peerMethods = peerMethods;\n hsyncClient.hsyncSecret = hsyncSecret;\n hsyncClient.hsyncServer = hsyncServer;\n hsyncClient.dynamicTimeout = dynamicTimeout;\n const { host, protocol } = new URL(hsyncServer);\n debug('url', host, protocol);\n if (protocol === 'wss:') {\n hsyncClient.webUrl = `https://${host}`;\n } else {\n hsyncClient.webUrl = `http://${host}`;\n }\n hsyncClient.webAdmin = `${hsyncClient.webUrl}/${hsyncBase}/admin`;\n hsyncClient.webBase = `${hsyncClient.webUrl}/${hsyncBase}`;\n hsyncClient.port = port;\n\n if (listenerLocalPort) {\n listenerLocalPort.forEach((llp, i) => {\n const lth = listenerTargetHost ? listenerTargetHost[i] : null;\n if (lth) {\n const ltp = listenerTargetPort ? listenerTargetPort[i] : llp;\n addSocketListener(llp, myHostName, ltp, lth);\n console.log('relaying local', llp, 'to', lth, ltp);\n }\n });\n }\n\n if (relayInboundPort) {\n relayInboundPort.forEach((rip, i) => {\n const rth = relayTargetHost ? relayTargetHost[i] : 'localhost';\n if (rth) {\n const rtp = relayTargetPort ? relayTargetPort[i] : rip;\n addSocketRelay(rip, myHostName, rtp, rth);\n console.log('relaying inbound', rip, 'to', rth, rtp);\n }\n });\n }\n\n return hsyncClient;\n}\n\nmodule.exports = {\n createHsync,\n setNet,\n setMqtt,\n};\n\n\n//# sourceURL=webpack://hsync/./connection.js?");
|
|
29
29
|
|
|
30
30
|
/***/ }),
|
|
31
31
|
|
|
@@ -65,7 +65,7 @@ eval("const rawr = __webpack_require__(/*! rawr */ \"./node_modules/rawr/index.j
|
|
|
65
65
|
\**************************************/
|
|
66
66
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
67
67
|
|
|
68
|
-
eval("const b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:listener');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\n// const { getRTCPeer } = require('./data-channel');\n\nconst { getRPCPeer } = __webpack_require__(/*! ./rpc */ \"./lib/rpc.js\");\n\nlet net;\n\nfunction setNet(netImpl) {\n net = netImpl;\n}\n\n\ndebugError.color = 1;\n\nconst sockets = {};\n\n// function receiveRelayData(socketId, data) {\n// if (sockets[socketId]) {\n// debug('receiveRelayData', socketId, data.length);\n// sockets[socketId].write(data);\n// }\n// }\n\nfunction receiveRelayData(requestInfo, { socketId, data }) {\n debug('receiveRelayData', socketId, data, 'sockets', Object.keys(sockets));\n if (!sockets[socketId]) {\n throw new Error('listener has no matching socket for relay: ' + socketId);\n }\n let dataBuffer = data;\n if (typeof dataBuffer === 'string') {\n dataBuffer = Buffer.from(dataBuffer, 'base64');\n }\n sockets[socketId].write(dataBuffer);\n return 'ok';\n}\n\nfunction createSocketListenHandler({hostName, port, targetPort, targetHost, hsyncClient}) {\n debug('creating handler', hostName, port, targetPort, targetHost);\n \n const rpcPeer = getRPCPeer({hostName, hsyncClient});\n\n debug('peer crated');\n\n const socketServer = net.createServer(async (socket) => {\n\n socket.socketId = b64id.generateId();\n sockets[socket.socketId] = socket;\n debug('connected to local listener', port, socket.socketId);\n socket.peerConnected = false;\n const pubTopic = `msg/${hostName}/${hsyncClient.myHostName}/socketData/${socket.socketId}`;\n const closeTopic = `msg/${hostName}/${hsyncClient.myHostName}/socketClose/${socket.socketId}`;\n const dataQueue = [];\n\n async function sendData(data) {\n debug('sending data', hostName, data.length);\n // const p = getRTCPeer(hostName, hsyncClient);\n // if (p.connected) {\n // p.send(`socketData/${socket.socketId}`, data);\n // return;\n // }\n // hsyncClient.mqConn.publish(pubTopic, data);\n const result = await rpcPeer.methods.receiveListenerData({\n socketId: socket.socketId,\n data: Buffer.from(data).toString('base64'),\n });\n debug('sendData from Listener', result);\n }\n\n socket.on('data', async (data) => {\n debug('socket data', data?.length);\n // if (!socket.peerConnected) {\n // dataQueue.push(data);\n // return;\n // }\n sendData(data);\n });\n \n socket.on('close', () => {\n debug('listener socket closed', port, socket.socketId);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n // hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n socket.on('error', (error) => {\n debug('socket error', hostName, socket.socketId, error);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n // hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n try {\n debug('connecting remotely', socket.socketId, targetPort);\n const result = await rpcPeer.methods.connectSocket({socketId: socket.socketId, port: targetPort});\n debug('connect result', result);\n socket.peerConnected = true;\n dataQueue.forEach(sendData);\n // const p = getRTCPeer(hostName, hsyncClient);\n // if (p.pc) {\n // p.createDC();\n // }\n \n } catch (e) {\n debugError('cant connect remotely', hostName, targetPort, e);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n socket.end();\n }\n \n\n });\n\n socketServer.listen(port);\n\n\n function end() {\n const sockKeys = Object.keys(sockets);\n sockKeys.forEach((sk) => {\n try {\n sockets[sk].end();\n delete sockets[sk];\n }\n catch(e) {\n debug('error closing socket', e);\n }\n });\n }\n\n return {\n socketServer,\n sockets,\n end,\n };\n}\n\nmodule.exports = { \n createSocketListenHandler,\n receiveRelayData,\n setNet,\n};\n\n//# sourceURL=webpack://hsync/./lib/socket-listen-handler.js?");
|
|
68
|
+
eval("const b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:listener');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\n// const { getRTCPeer } = require('./data-channel');\n\nconst { getRPCPeer } = __webpack_require__(/*! ./rpc */ \"./lib/rpc.js\");\n\nlet net;\n\nfunction setNet(netImpl) {\n net = netImpl;\n}\n\n\ndebugError.color = 1;\n\nconst sockets = {};\n\n// function receiveRelayData(socketId, data) {\n// if (sockets[socketId]) {\n// debug('receiveRelayData', socketId, data.length);\n// sockets[socketId].write(data);\n// }\n// }\n\nfunction receiveRelayData(requestInfo, { socketId, data }) {\n debug('receiveRelayData', socketId, data, 'sockets', Object.keys(sockets));\n if (!sockets[socketId]) {\n throw new Error('listener has no matching socket for relay: ' + socketId);\n }\n let dataBuffer = data;\n if (typeof dataBuffer === 'string') {\n dataBuffer = Buffer.from(dataBuffer, 'base64');\n }\n sockets[socketId].write(dataBuffer);\n return 'ok';\n}\n\nfunction createSocketListenHandler({hostName, port, targetPort, targetHost, hsyncClient}) {\n debug('creating handler', { hostName, port, targetPort, targetHost });\n \n // const rpcPeer = getRPCPeer({hostName, hsyncClient});\n const rpcPeer = getRPCPeer({hostName: targetHost, hsyncClient});\n\n debug('peer crated');\n\n const socketServer = net.createServer(async (socket) => {\n\n socket.socketId = b64id.generateId();\n sockets[socket.socketId] = socket;\n debug('connected to local listener', port, socket.socketId);\n socket.peerConnected = false;\n const pubTopic = `msg/${hostName}/${hsyncClient.myHostName}/socketData/${socket.socketId}`;\n const closeTopic = `msg/${hostName}/${hsyncClient.myHostName}/socketClose/${socket.socketId}`;\n const dataQueue = [];\n\n async function sendData(data) {\n debug('sending data', hostName, data.length);\n // const p = getRTCPeer(hostName, hsyncClient);\n // if (p.connected) {\n // p.send(`socketData/${socket.socketId}`, data);\n // return;\n // }\n // hsyncClient.mqConn.publish(pubTopic, data);\n const result = await rpcPeer.methods.receiveListenerData({\n socketId: socket.socketId,\n data: Buffer.from(data).toString('base64'),\n });\n debug('sendData from Listener', result);\n }\n\n socket.on('data', async (data) => {\n debug('socket data', data?.length);\n // if (!socket.peerConnected) {\n // dataQueue.push(data);\n // return;\n // }\n sendData(data);\n });\n \n socket.on('close', () => {\n debug('listener socket closed', port, socket.socketId);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n // hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n socket.on('error', (error) => {\n debug('socket error', hostName, socket.socketId, error);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n // hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n try {\n debug('connecting remotely', socket.socketId, targetPort);\n const result = await rpcPeer.methods.connectSocket({socketId: socket.socketId, port: targetPort});\n debug('connect result', result);\n socket.peerConnected = true;\n dataQueue.forEach(sendData);\n // const p = getRTCPeer(hostName, hsyncClient);\n // if (p.pc) {\n // p.createDC();\n // }\n \n } catch (e) {\n debugError('cant connect remotely', hostName, targetPort, e);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n socket.end();\n }\n \n\n });\n\n socketServer.listen(port);\n\n\n function end() {\n const sockKeys = Object.keys(sockets);\n sockKeys.forEach((sk) => {\n try {\n sockets[sk].end();\n delete sockets[sk];\n }\n catch(e) {\n debug('error closing socket', e);\n }\n });\n }\n\n return {\n socketServer,\n sockets,\n end,\n };\n}\n\nmodule.exports = { \n createSocketListenHandler,\n receiveRelayData,\n setNet,\n};\n\n//# sourceURL=webpack://hsync/./lib/socket-listen-handler.js?");
|
|
69
69
|
|
|
70
70
|
/***/ }),
|
|
71
71
|
|
|
@@ -95,7 +95,7 @@ eval("const debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/
|
|
|
95
95
|
\*************************************/
|
|
96
96
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
97
97
|
|
|
98
|
-
eval("const base64 = __webpack_require__(/*! base64-url */ \"./node_modules/base64-url/index.js\");\nconst uuidv4 = __webpack_require__(/*! uuid
|
|
98
|
+
eval("const base64 = __webpack_require__(/*! base64-url */ \"./node_modules/base64-url/index.js\");\nconst uuidv4 = (__webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/commonjs-browser/index.js\").v4);\n\nfunction uuidToB64(uuidStr) {\n const buf = Buffer.from(uuidStr.replace(/\\-/g, ''), 'hex');\n return base64.encode(buf);\n}\n\nfunction b64ToUuid(b64Str) {\n const uuid = Buffer.from(base64.unescape(b64Str), 'base64').toString('hex');\n return `${uuid.substring(0, 8)}-${uuid.substring(8, 12)}-${uuid.substring(12, 16)}-${uuid.substring(16, 20)}-${uuid.substring(20)}`;\n}\n\nfunction generateId() {\n return uuidToB64(uuidv4());\n}\n\nmodule.exports = {\n b64ToUuid,\n uuidToB64,\n generateId\n};\n\n//# sourceURL=webpack://hsync/./node_modules/b64id/index.js?");
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
@@ -263,33 +263,179 @@ eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_module
|
|
|
263
263
|
|
|
264
264
|
/***/ }),
|
|
265
265
|
|
|
266
|
-
/***/ "./node_modules/uuid/
|
|
267
|
-
|
|
268
|
-
!*** ./node_modules/uuid/
|
|
269
|
-
|
|
270
|
-
/***/ ((
|
|
266
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/index.js":
|
|
267
|
+
/*!**********************************************************!*\
|
|
268
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/index.js ***!
|
|
269
|
+
\**********************************************************/
|
|
270
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
"use strict";
|
|
273
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"NIL\", ({\n enumerable: true,\n get: function get() {\n return _nil.default;\n }\n}));\nObject.defineProperty(exports, \"parse\", ({\n enumerable: true,\n get: function get() {\n return _parse.default;\n }\n}));\nObject.defineProperty(exports, \"stringify\", ({\n enumerable: true,\n get: function get() {\n return _stringify.default;\n }\n}));\nObject.defineProperty(exports, \"v1\", ({\n enumerable: true,\n get: function get() {\n return _v.default;\n }\n}));\nObject.defineProperty(exports, \"v3\", ({\n enumerable: true,\n get: function get() {\n return _v2.default;\n }\n}));\nObject.defineProperty(exports, \"v4\", ({\n enumerable: true,\n get: function get() {\n return _v3.default;\n }\n}));\nObject.defineProperty(exports, \"v5\", ({\n enumerable: true,\n get: function get() {\n return _v4.default;\n }\n}));\nObject.defineProperty(exports, \"validate\", ({\n enumerable: true,\n get: function get() {\n return _validate.default;\n }\n}));\nObject.defineProperty(exports, \"version\", ({\n enumerable: true,\n get: function get() {\n return _version.default;\n }\n}));\n\nvar _v = _interopRequireDefault(__webpack_require__(/*! ./v1.js */ \"./node_modules/uuid/dist/commonjs-browser/v1.js\"));\n\nvar _v2 = _interopRequireDefault(__webpack_require__(/*! ./v3.js */ \"./node_modules/uuid/dist/commonjs-browser/v3.js\"));\n\nvar _v3 = _interopRequireDefault(__webpack_require__(/*! ./v4.js */ \"./node_modules/uuid/dist/commonjs-browser/v4.js\"));\n\nvar _v4 = _interopRequireDefault(__webpack_require__(/*! ./v5.js */ \"./node_modules/uuid/dist/commonjs-browser/v5.js\"));\n\nvar _nil = _interopRequireDefault(__webpack_require__(/*! ./nil.js */ \"./node_modules/uuid/dist/commonjs-browser/nil.js\"));\n\nvar _version = _interopRequireDefault(__webpack_require__(/*! ./version.js */ \"./node_modules/uuid/dist/commonjs-browser/version.js\"));\n\nvar _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/commonjs-browser/validate.js\"));\n\nvar _stringify = _interopRequireDefault(__webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/commonjs-browser/stringify.js\"));\n\nvar _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ \"./node_modules/uuid/dist/commonjs-browser/parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/index.js?");
|
|
273
274
|
|
|
274
275
|
/***/ }),
|
|
275
276
|
|
|
276
|
-
/***/ "./node_modules/uuid/
|
|
277
|
-
|
|
278
|
-
!*** ./node_modules/uuid/
|
|
279
|
-
|
|
280
|
-
/***/ ((
|
|
277
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/md5.js":
|
|
278
|
+
/*!********************************************************!*\
|
|
279
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/md5.js ***!
|
|
280
|
+
\********************************************************/
|
|
281
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
281
282
|
|
|
282
|
-
|
|
283
|
+
"use strict";
|
|
284
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\n/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (let i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n const output = [];\n const length32 = input.length * 32;\n const hexTab = '0123456789abcdef';\n\n for (let i = 0; i < length32; i += 8) {\n const x = input[i >> 5] >>> i % 32 & 0xff;\n const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n let a = 1732584193;\n let b = -271733879;\n let c = -1732584194;\n let d = 271733878;\n\n for (let i = 0; i < x.length; i += 16) {\n const olda = a;\n const oldb = b;\n const oldc = c;\n const oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n const length8 = input.length * 8;\n const output = new Uint32Array(getOutputLength(length8));\n\n for (let i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n const lsw = (x & 0xffff) + (y & 0xffff);\n const msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nvar _default = md5;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/md5.js?");
|
|
283
285
|
|
|
284
286
|
/***/ }),
|
|
285
287
|
|
|
286
|
-
/***/ "./node_modules/uuid/
|
|
287
|
-
|
|
288
|
-
!*** ./node_modules/uuid/
|
|
289
|
-
|
|
290
|
-
/***/ ((
|
|
288
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/native.js":
|
|
289
|
+
/*!***********************************************************!*\
|
|
290
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/native.js ***!
|
|
291
|
+
\***********************************************************/
|
|
292
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
293
|
+
|
|
294
|
+
"use strict";
|
|
295
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nconst randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nvar _default = {\n randomUUID\n};\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/native.js?");
|
|
296
|
+
|
|
297
|
+
/***/ }),
|
|
298
|
+
|
|
299
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/nil.js":
|
|
300
|
+
/*!********************************************************!*\
|
|
301
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/nil.js ***!
|
|
302
|
+
\********************************************************/
|
|
303
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
304
|
+
|
|
305
|
+
"use strict";
|
|
306
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/nil.js?");
|
|
307
|
+
|
|
308
|
+
/***/ }),
|
|
309
|
+
|
|
310
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/parse.js":
|
|
311
|
+
/*!**********************************************************!*\
|
|
312
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/parse.js ***!
|
|
313
|
+
\**********************************************************/
|
|
314
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
315
|
+
|
|
316
|
+
"use strict";
|
|
317
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/commonjs-browser/validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/parse.js?");
|
|
318
|
+
|
|
319
|
+
/***/ }),
|
|
320
|
+
|
|
321
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/regex.js":
|
|
322
|
+
/*!**********************************************************!*\
|
|
323
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/regex.js ***!
|
|
324
|
+
\**********************************************************/
|
|
325
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
326
|
+
|
|
327
|
+
"use strict";
|
|
328
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/regex.js?");
|
|
329
|
+
|
|
330
|
+
/***/ }),
|
|
331
|
+
|
|
332
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/rng.js":
|
|
333
|
+
/*!********************************************************!*\
|
|
334
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/rng.js ***!
|
|
335
|
+
\********************************************************/
|
|
336
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
337
|
+
|
|
338
|
+
"use strict";
|
|
339
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = rng;\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\n\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/rng.js?");
|
|
340
|
+
|
|
341
|
+
/***/ }),
|
|
342
|
+
|
|
343
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/sha1.js":
|
|
344
|
+
/*!*********************************************************!*\
|
|
345
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/sha1.js ***!
|
|
346
|
+
\*********************************************************/
|
|
347
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
348
|
+
|
|
349
|
+
"use strict";
|
|
350
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\n// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (let i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; ++i) {\n const arr = new Uint32Array(16);\n\n for (let j = 0; j < 16; ++j) {\n arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];\n }\n\n M[i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (let i = 0; i < N; ++i) {\n const W = new Uint32Array(80);\n\n for (let t = 0; t < 16; ++t) {\n W[t] = M[i][t];\n }\n\n for (let t = 16; t < 80; ++t) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; ++t) {\n const s = Math.floor(t / 20);\n const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nvar _default = sha1;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/sha1.js?");
|
|
351
|
+
|
|
352
|
+
/***/ }),
|
|
291
353
|
|
|
292
|
-
|
|
354
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/stringify.js":
|
|
355
|
+
/*!**************************************************************!*\
|
|
356
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/stringify.js ***!
|
|
357
|
+
\**************************************************************/
|
|
358
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
359
|
+
|
|
360
|
+
"use strict";
|
|
361
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nexports.unsafeStringify = unsafeStringify;\n\nvar _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/commonjs-browser/validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/stringify.js?");
|
|
362
|
+
|
|
363
|
+
/***/ }),
|
|
364
|
+
|
|
365
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/v1.js":
|
|
366
|
+
/*!*******************************************************!*\
|
|
367
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/v1.js ***!
|
|
368
|
+
\*******************************************************/
|
|
369
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
370
|
+
|
|
371
|
+
"use strict";
|
|
372
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ \"./node_modules/uuid/dist/commonjs-browser/rng.js\"));\n\nvar _stringify = __webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/commonjs-browser/stringify.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.unsafeStringify)(b);\n}\n\nvar _default = v1;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/v1.js?");
|
|
373
|
+
|
|
374
|
+
/***/ }),
|
|
375
|
+
|
|
376
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/v3.js":
|
|
377
|
+
/*!*******************************************************!*\
|
|
378
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/v3.js ***!
|
|
379
|
+
\*******************************************************/
|
|
380
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
381
|
+
|
|
382
|
+
"use strict";
|
|
383
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ \"./node_modules/uuid/dist/commonjs-browser/v35.js\"));\n\nvar _md = _interopRequireDefault(__webpack_require__(/*! ./md5.js */ \"./node_modules/uuid/dist/commonjs-browser/md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/v3.js?");
|
|
384
|
+
|
|
385
|
+
/***/ }),
|
|
386
|
+
|
|
387
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/v35.js":
|
|
388
|
+
/*!********************************************************!*\
|
|
389
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/v35.js ***!
|
|
390
|
+
\********************************************************/
|
|
391
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
392
|
+
|
|
393
|
+
"use strict";
|
|
394
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.URL = exports.DNS = void 0;\nexports[\"default\"] = v35;\n\nvar _stringify = __webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/commonjs-browser/stringify.js\");\n\nvar _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ \"./node_modules/uuid/dist/commonjs-browser/parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction v35(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n var _namespace;\n\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.unsafeStringify)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/v35.js?");
|
|
395
|
+
|
|
396
|
+
/***/ }),
|
|
397
|
+
|
|
398
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/v4.js":
|
|
399
|
+
/*!*******************************************************!*\
|
|
400
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/v4.js ***!
|
|
401
|
+
\*******************************************************/
|
|
402
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
403
|
+
|
|
404
|
+
"use strict";
|
|
405
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _native = _interopRequireDefault(__webpack_require__(/*! ./native.js */ \"./node_modules/uuid/dist/commonjs-browser/native.js\"));\n\nvar _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ \"./node_modules/uuid/dist/commonjs-browser/rng.js\"));\n\nvar _stringify = __webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/commonjs-browser/stringify.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n if (_native.default.randomUUID && !buf && !options) {\n return _native.default.randomUUID();\n }\n\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.unsafeStringify)(rnds);\n}\n\nvar _default = v4;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/v4.js?");
|
|
406
|
+
|
|
407
|
+
/***/ }),
|
|
408
|
+
|
|
409
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/v5.js":
|
|
410
|
+
/*!*******************************************************!*\
|
|
411
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/v5.js ***!
|
|
412
|
+
\*******************************************************/
|
|
413
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
414
|
+
|
|
415
|
+
"use strict";
|
|
416
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ \"./node_modules/uuid/dist/commonjs-browser/v35.js\"));\n\nvar _sha = _interopRequireDefault(__webpack_require__(/*! ./sha1.js */ \"./node_modules/uuid/dist/commonjs-browser/sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/v5.js?");
|
|
417
|
+
|
|
418
|
+
/***/ }),
|
|
419
|
+
|
|
420
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/validate.js":
|
|
421
|
+
/*!*************************************************************!*\
|
|
422
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/validate.js ***!
|
|
423
|
+
\*************************************************************/
|
|
424
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
425
|
+
|
|
426
|
+
"use strict";
|
|
427
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _regex = _interopRequireDefault(__webpack_require__(/*! ./regex.js */ \"./node_modules/uuid/dist/commonjs-browser/regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/validate.js?");
|
|
428
|
+
|
|
429
|
+
/***/ }),
|
|
430
|
+
|
|
431
|
+
/***/ "./node_modules/uuid/dist/commonjs-browser/version.js":
|
|
432
|
+
/*!************************************************************!*\
|
|
433
|
+
!*** ./node_modules/uuid/dist/commonjs-browser/version.js ***!
|
|
434
|
+
\************************************************************/
|
|
435
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
436
|
+
|
|
437
|
+
"use strict";
|
|
438
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/commonjs-browser/validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.slice(14, 15), 16);\n}\n\nvar _default = version;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/dist/commonjs-browser/version.js?");
|
|
293
439
|
|
|
294
440
|
/***/ }),
|
|
295
441
|
|
|
@@ -321,7 +467,7 @@ eval("/*! For license information please see mqtt.browser.js.LICENSE.txt */\n!fu
|
|
|
321
467
|
/***/ ((module) => {
|
|
322
468
|
|
|
323
469
|
"use strict";
|
|
324
|
-
eval("module.exports = JSON.parse('{\"
|
|
470
|
+
eval("module.exports = JSON.parse('{\"name\":\"net-web\",\"version\":\"0.2.0\",\"description\":\"a global(page) node net shim for the web\",\"main\":\"net-web.js\",\"scripts\":{\"test\":\"echo \\\\\"Error: no test specified\\\\\" && exit 1\",\"build\":\"webpack && BUILD_MODE=production webpack\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/monteslu/net-web.git\"},\"author\":\"Luis Montes\",\"license\":\"ISC\",\"devDependencies\":{\"webpack\":\"^5.75.0\",\"webpack-cli\":\"^5.0.1\"}}');\n\n//# sourceURL=webpack://hsync/./node_modules/net-web/package.json?");
|
|
325
471
|
|
|
326
472
|
/***/ })
|
|
327
473
|
|