diff options
author | Florian Rinke <develop@torui.de> | 2021-09-05 12:08:18 +0200 |
---|---|---|
committer | Florian Rinke <develop@torui.de> | 2021-09-05 12:08:18 +0200 |
commit | f88b74485ffdf42ca2b62c72fb746082e7fc012f (patch) | |
tree | 7c536169d9b50a098549daa469f970e672b3dd19 /mock | |
parent | d574e83ac221ce7b74756cfa8417904831ea245e (diff) | |
download | COFL-f88b74485ffdf42ca2b62c72fb746082e7fc012f.tar.gz COFL-f88b74485ffdf42ca2b62c72fb746082e7fc012f.tar.bz2 COFL-f88b74485ffdf42ca2b62c72fb746082e7fc012f.zip |
add to github
Diffstat (limited to 'mock')
-rw-r--r-- | mock/.gitignore | 1 | ||||
-rw-r--r-- | mock/index.mjs | 16 | ||||
-rw-r--r-- | mock/package-lock.json | 13 | ||||
-rw-r--r-- | mock/package.json | 13 |
4 files changed, 43 insertions, 0 deletions
diff --git a/mock/.gitignore b/mock/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/mock/.gitignore @@ -0,0 +1 @@ +node_modules/
\ No newline at end of file diff --git a/mock/index.mjs b/mock/index.mjs new file mode 100644 index 0000000..915b18a --- /dev/null +++ b/mock/index.mjs @@ -0,0 +1,16 @@ +import { WebSocketServer } from 'ws'; + +const wss = new WebSocketServer({ port: 8080 }); + +wss.on('connection', function connection(ws) { + console.log("Connected"); + ws.on('message', function incoming(message) { + console.log('received: %s', message); + }); + + ws.send(JSON.stringify({ + type: "execute", + data: "/say Owo" + })); +}); +console.log("Listening..");
\ No newline at end of file diff --git a/mock/package-lock.json b/mock/package-lock.json new file mode 100644 index 0000000..fecc0ce --- /dev/null +++ b/mock/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "mock", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ws": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.0.tgz", + "integrity": "sha512-uYhVJ/m9oXwEI04iIVmgLmugh2qrZihkywG9y5FfZV2ATeLIzHf93qs+tUNqlttbQK957/VX3mtwAS+UfIwA4g==" + } + } +} diff --git a/mock/package.json b/mock/package.json new file mode 100644 index 0000000..7270526 --- /dev/null +++ b/mock/package.json @@ -0,0 +1,13 @@ +{ + "name": "mock", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + }, + "author": "", + "license": "ISC", + "dependencies": { + "ws": "^8.2.0" + } +} |