From e77a48ebb8d26b57aedd885e4184563c158a3d0d Mon Sep 17 00:00:00 2001 From: jsrobson10 Date: Sun, 24 Mar 2019 17:57:54 +1100 Subject: [PATCH] Initial Commit --- LICENSE | 21 ++++++++ README.md | 9 ++++ main.js | 21 ++++++++ node_modules/.bin/electron | 1 + node_modules/.bin/electron-download | 1 + node_modules/.bin/extract-zip | 1 + node_modules/.bin/mkdirp | 1 + node_modules/.bin/nugget | 1 + node_modules/.bin/pretty-bytes | 1 + node_modules/.bin/rc | 1 + node_modules/.bin/semver | 1 + node_modules/.bin/sshpk-conv | 1 + node_modules/.bin/sshpk-sign | 1 + node_modules/.bin/sshpk-verify | 1 + node_modules/.bin/strip-indent | 1 + node_modules/.bin/uuid | 1 + node_modules/fs/README.md | 9 ++++ node_modules/fs/package.json | 69 ++++++++++++++++++++++++++ node_modules/net/LICENSE | 19 ++++++++ node_modules/net/README.md | 0 node_modules/net/index.js | 28 +++++++++++ node_modules/net/package.json | 76 +++++++++++++++++++++++++++++ node_modules/net/test.js | 6 +++ 23 files changed, 271 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 main.js create mode 120000 node_modules/.bin/electron create mode 120000 node_modules/.bin/electron-download create mode 120000 node_modules/.bin/extract-zip create mode 120000 node_modules/.bin/mkdirp create mode 120000 node_modules/.bin/nugget create mode 120000 node_modules/.bin/pretty-bytes create mode 120000 node_modules/.bin/rc create mode 120000 node_modules/.bin/semver create mode 120000 node_modules/.bin/sshpk-conv create mode 120000 node_modules/.bin/sshpk-sign create mode 120000 node_modules/.bin/sshpk-verify create mode 120000 node_modules/.bin/strip-indent create mode 120000 node_modules/.bin/uuid create mode 100644 node_modules/fs/README.md create mode 100644 node_modules/fs/package.json create mode 100644 node_modules/net/LICENSE create mode 100644 node_modules/net/README.md create mode 100644 node_modules/net/index.js create mode 100644 node_modules/net/package.json create mode 100644 node_modules/net/test.js diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8b23445 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6b1ae6f --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# chat-server +An open source chat server for the chat client + +# Required software +- NodeJs + +# Required libraries +- net +- fs diff --git a/main.js b/main.js new file mode 100644 index 0000000..5adf8d8 --- /dev/null +++ b/main.js @@ -0,0 +1,21 @@ +#!/usr/bin/node + +// Get some libraries +const net = require("net"); +const fs = require("fs"); + +// Create a server +var server = net.createServer(function(socket) +{ + // Send back a connected message + socket.write(JSON.stringify({connected: true})); + console.log("connected"); + + socket.on('data', function(data) + { + console.log("recieved: "+data); + }); +}); + +// Listen for data +server.listen(22068, ''); diff --git a/node_modules/.bin/electron b/node_modules/.bin/electron new file mode 120000 index 0000000..946101e --- /dev/null +++ b/node_modules/.bin/electron @@ -0,0 +1 @@ +../electron/cli.js \ No newline at end of file diff --git a/node_modules/.bin/electron-download b/node_modules/.bin/electron-download new file mode 120000 index 0000000..bfc798a --- /dev/null +++ b/node_modules/.bin/electron-download @@ -0,0 +1 @@ +../electron-download/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/extract-zip b/node_modules/.bin/extract-zip new file mode 120000 index 0000000..af9b561 --- /dev/null +++ b/node_modules/.bin/extract-zip @@ -0,0 +1 @@ +../extract-zip/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 0000000..017896c --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/nugget b/node_modules/.bin/nugget new file mode 120000 index 0000000..eccbe4c --- /dev/null +++ b/node_modules/.bin/nugget @@ -0,0 +1 @@ +../nugget/bin.js \ No newline at end of file diff --git a/node_modules/.bin/pretty-bytes b/node_modules/.bin/pretty-bytes new file mode 120000 index 0000000..d1d4ed6 --- /dev/null +++ b/node_modules/.bin/pretty-bytes @@ -0,0 +1 @@ +../pretty-bytes/cli.js \ No newline at end of file diff --git a/node_modules/.bin/rc b/node_modules/.bin/rc new file mode 120000 index 0000000..48b3cda --- /dev/null +++ b/node_modules/.bin/rc @@ -0,0 +1 @@ +../rc/cli.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/.bin/sshpk-conv b/node_modules/.bin/sshpk-conv new file mode 120000 index 0000000..a2a295c --- /dev/null +++ b/node_modules/.bin/sshpk-conv @@ -0,0 +1 @@ +../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/node_modules/.bin/sshpk-sign b/node_modules/.bin/sshpk-sign new file mode 120000 index 0000000..766b9b3 --- /dev/null +++ b/node_modules/.bin/sshpk-sign @@ -0,0 +1 @@ +../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/node_modules/.bin/sshpk-verify b/node_modules/.bin/sshpk-verify new file mode 120000 index 0000000..bfd7e3a --- /dev/null +++ b/node_modules/.bin/sshpk-verify @@ -0,0 +1 @@ +../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/node_modules/.bin/strip-indent b/node_modules/.bin/strip-indent new file mode 120000 index 0000000..dddee7e --- /dev/null +++ b/node_modules/.bin/strip-indent @@ -0,0 +1 @@ +../strip-indent/cli.js \ No newline at end of file diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 120000 index 0000000..b3e45bc --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/fs/README.md b/node_modules/fs/README.md new file mode 100644 index 0000000..5e9a74c --- /dev/null +++ b/node_modules/fs/README.md @@ -0,0 +1,9 @@ +# Security holding package + +This package name is not currently in use, but was formerly occupied +by another package. To avoid malicious use, npm is hanging on to the +package name, but loosely, and we'll probably give it to you if you +want it. + +You may adopt this package by contacting support@npmjs.com and +requesting the name. diff --git a/node_modules/fs/package.json b/node_modules/fs/package.json new file mode 100644 index 0000000..1cd04ae --- /dev/null +++ b/node_modules/fs/package.json @@ -0,0 +1,69 @@ +{ + "_args": [ + [ + "fs", + "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server" + ] + ], + "_from": "fs@latest", + "_id": "fs@0.0.1-security", + "_inCache": true, + "_installable": true, + "_location": "/fs", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "ernie@npmjs.com", + "name": "ehsalazar" + }, + "_npmVersion": "3.10.5", + "_phantomChildren": {}, + "_requested": { + "name": "fs", + "raw": "fs", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "_shasum": "8a7bd37186b6dddf3813f23858b57ecaaf5e41d4", + "_shrinkwrap": null, + "_spec": "fs", + "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server", + "author": "", + "bugs": { + "url": "https://github.com/npm/security-holder/issues" + }, + "dependencies": {}, + "description": "This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "8a7bd37186b6dddf3813f23858b57ecaaf5e41d4", + "tarball": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz" + }, + "homepage": "https://github.com/npm/security-holder#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "ehsalazar", + "email": "ernie@npmjs.com" + } + ], + "name": "fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/security-holder.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "0.0.1-security" +} diff --git a/node_modules/net/LICENSE b/node_modules/net/LICENSE new file mode 100644 index 0000000..8952fa5 --- /dev/null +++ b/node_modules/net/LICENSE @@ -0,0 +1,19 @@ +Copyright 2011 Sleepless Software Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/net/README.md b/node_modules/net/README.md new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/net/index.js b/node_modules/net/index.js new file mode 100644 index 0000000..7120071 --- /dev/null +++ b/node_modules/net/index.js @@ -0,0 +1,28 @@ +/* +Copyright 2013 Sleepless Software Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +*/ + +// yes, I know this seems stupid, but I have my reasons. + +var net = require("net") +for(k in net) + global[k] = net[k] + diff --git a/node_modules/net/package.json b/node_modules/net/package.json new file mode 100644 index 0000000..8536090 --- /dev/null +++ b/node_modules/net/package.json @@ -0,0 +1,76 @@ +{ + "_args": [ + [ + "net", + "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server" + ] + ], + "_from": "net@latest", + "_id": "net@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/net", + "_npmUser": { + "email": "joe@sleepless.com", + "name": "sleeplessinc" + }, + "_npmVersion": "1.2.11", + "_phantomChildren": {}, + "_requested": { + "name": "net", + "raw": "net", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER" + ], + "_resolved": "https://registry.npmjs.org/net/-/net-1.0.2.tgz", + "_shasum": "d1757ec9a7fb2371d83cf4755ce3e27e10829388", + "_shrinkwrap": null, + "_spec": "net", + "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-server", + "author": { + "email": "joe@sleepless.com", + "name": "Joe Hitchens", + "url": "sleepless.com" + }, + "bugs": { + "url": "https://github.com/sleeplessinc/net/issues" + }, + "dependencies": {}, + "description": "Globalizes the 'net' module functions", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "d1757ec9a7fb2371d83cf4755ce3e27e10829388", + "tarball": "https://registry.npmjs.org/net/-/net-1.0.2.tgz" + }, + "homepage": "https://github.com/sleeplessinc/net#readme", + "license": { + "type": "MIT", + "url": "https://github.com/sleeplessinc/net/raw/master/LICENSE" + }, + "maintainers": [ + { + "name": "sleeplessinc", + "email": "joe@sleepless.com" + } + ], + "name": "net", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repositories": [ + { + "type": "git", + "url": "git+https://sleeplessinc@github.com/sleeplessinc/net.git" + } + ], + "repository": { + "type": "git", + "url": "git+https://sleeplessinc@github.com/sleeplessinc/net.git" + }, + "version": "1.0.2" +} diff --git a/node_modules/net/test.js b/node_modules/net/test.js new file mode 100644 index 0000000..b6a7040 --- /dev/null +++ b/node_modules/net/test.js @@ -0,0 +1,6 @@ + +var i = require("./index.js") + +console.log(Socket instanceof Function) + +