Skip to content

Commit

Permalink
converting - new architecture & format
Browse files Browse the repository at this point in the history
  • Loading branch information
universalweb committed Mar 6, 2023
1 parent ff283c9 commit 2d2c8ec
Show file tree
Hide file tree
Showing 24 changed files with 458 additions and 1,369 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
},
"ImportDeclaration": {
"multiline": true,
"minProperties": 5
"minProperties": 3
},
"ExportDeclaration": {
"multiline": true,
"minProperties": 5
"minProperties": 3
}
}
],
Expand Down
15 changes: 0 additions & 15 deletions .jsbeautifyrc

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#1073cf2d",
"editor.lineHighlightBorder": "#9fced11f"
}
},
"sarif-viewer.connectToGithubCodeScanning": "off"
}
62 changes: 31 additions & 31 deletions packetDesign.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
## Universal Web Socket - PACKET DESIGN
# Universal Web Socket - PACKET DESIGN

#### PACKET HEADERS (MSGPack Object)(OPTIONAL ENCRYPTION)

- Nonce
- Identity Certificate (OPTIONAL)(REQUIRED AT START)
- Socket ID (CLIENT/SERVER)
- May indicate which server to send to for load balancing
- May indicate which domain to send to for virtual hosts
- May be entirely random
- Nonce
- Identity Certificate (OPTIONAL)(REQUIRED AT START)
- Socket ID (CLIENT/SERVER)
- May indicate which server to send to for load balancing
- May indicate which domain to send to for virtual hosts
- May be entirely random

---

#### PROPERTY NAMES & MEANINGS

- id - Connection ID (MANDATORY)
- api - API function that is requested (OPTIONAL)
- Watcher (OPTIONAL)
- Head (OPTIONAL)
- Body (OPTIONAL) (MSGPack Object)
- Pid - Packet ID (MANDATORY)
- Status - Status Code (OPTIONAL)
- If status is left blank it defaults to 200 or is considered a success
- end - Kill connection (OPTIONAL)
- Puzzle - Solve a puzzle to continue (OPTIONAL)
- ReKey (OPTIONAL)
- scid - Server connection ID (OPTIONAL)
- id - Connection ID (MANDATORY)
- api - API function that is requested (OPTIONAL)
- Watcher (OPTIONAL)
- Head (OPTIONAL)
- Body (OPTIONAL) (MSGPack Object)
- Pid - Packet ID (MANDATORY)
- Status - Status Code (OPTIONAL)
- If status is left blank it defaults to 200 or is considered a success
- end - Kill connection (OPTIONAL)
- Puzzle - Solve a puzzle to continue (OPTIONAL)
- ReKey (OPTIONAL)
- scid - Server connection ID (OPTIONAL)

---

Expand All @@ -39,23 +39,23 @@

##### IPv6 HEADERS

- Version
- Traffic Class
- Flow Label
- Payload Length
- Next Header
- Hop Limit
- Source Address
- Destination Address
- Version
- Traffic Class
- Flow Label
- Payload Length
- Next Header
- Hop Limit
- Source Address
- Destination Address

##### UDP HEADERS

These are the standard UDP headers sent over:

- Source Port Number
- Destination Port Number
- Length
- Checksum
- Source Port Number
- Destination Port Number
- Length
- Checksum

##### MAIN HEADERS

Expand Down
15 changes: 9 additions & 6 deletions state/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { eachAsyncArray, construct } from 'Acid';
import { eachAsyncObject, construct, assign } from 'Acid';
import logs from '../utilities/logs/index.js';
import msgpack from '../utilities/msgpack/index.js';
import cryptoLib from '../utilities/crypto/index.js';
import certificate from '../utilities/certificate/index.js';
import file from '../utilities/file/index.js';
class State {
constructor(type, existingState) {
this.type = type;
this.utility = require('Acid');
}
modules = ['console', 'msgpack', 'file', 'crypto', 'certificate'];
getUtil() {
getUtil(modules) {
const thisClass = this;
eachAsyncArray(this.modules, async (item) => {
const imported = await import(`../utilities/${item}/`);
await imported(thisClass);
eachAsyncObject(modules, async (item, key) => {
thisClass[key] = await import(`../utilities/${item}/`);
});
}
}
Expand Down
Loading

0 comments on commit 2d2c8ec

Please sign in to comment.