hacker-lobby 1.1.0 → 1.1.1
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 +48 -44
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
# 📟 Hacker Lobby
|
|
2
2
|
|
|
3
|
-
A secure, real-time, multiplayer terminal chat application
|
|
3
|
+
A secure, real-time, multiplayer terminal chat application that connects hackers globally. The application runs entirely within your terminal, utilizing a serverless Cloudflare Workers and D1 database backend on the edge to deliver real-time messaging without latency.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 🌍 Global Access & Connecting Globally
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Hacker Lobby is designed to connect people globally. When you run the application, it connects to a production server deployed on Cloudflare's serverless edge network. This allows you to chat in real-time with developers and terminal enthusiasts from all around the world.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
* **Global API Backend URL**: `https://hacker-lobby-backend.spidozx.workers.dev`
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 📥 Prerequisites: Downloading Node.js and npm
|
|
16
|
+
|
|
17
|
+
To run the Hacker Lobby client, you need **Node.js** installed on your system.
|
|
18
|
+
|
|
19
|
+
When you install Node.js, it automatically installs:
|
|
20
|
+
1. **npm (Node Package Manager)**: Used for installing and managing Node.js packages.
|
|
21
|
+
2. **npx (Node Package Runner)**: Used to execute Node.js CLI packages directly without manual global installation.
|
|
22
|
+
|
|
23
|
+
### How to Download and Install
|
|
12
24
|
|
|
13
25
|
#### 🪟 Windows
|
|
14
|
-
* **Direct Installer**: Download the recommended LTS installer from the [official Node.js website](https://nodejs.org/). Run the `.msi` file and follow the
|
|
26
|
+
* **Direct Installer**: Download the recommended LTS installer from the [official Node.js website](https://nodejs.org/). Run the downloaded `.msi` file and follow the installer prompts.
|
|
15
27
|
* **Terminal (Winget)**: Open PowerShell or Command Prompt as administrator and run:
|
|
16
28
|
```powershell
|
|
17
29
|
winget install OpenJS.NodeJS
|
|
@@ -25,75 +37,67 @@ To run the Hacker Lobby client and server, you need **Node.js** installed on you
|
|
|
25
37
|
```
|
|
26
38
|
|
|
27
39
|
#### 🐧 Linux (Ubuntu/Debian)
|
|
28
|
-
Open Terminal and run the following
|
|
40
|
+
Open Terminal and run the following commands to install Node.js and npm:
|
|
29
41
|
```bash
|
|
30
42
|
sudo apt update
|
|
31
43
|
sudo apt install nodejs npm -y
|
|
32
44
|
```
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### 💻 2. Accessing and Verifying via Terminal
|
|
37
|
-
|
|
38
|
-
Once installed, restart your terminal application (PowerShell, Command Prompt, or bash) and verify the installation:
|
|
46
|
+
### Verifying Your Installation
|
|
47
|
+
Once the installation is complete, restart your terminal application (PowerShell, Command Prompt, or bash) and verify the setup:
|
|
39
48
|
|
|
40
|
-
1. **Verify Node.js
|
|
49
|
+
1. **Verify Node.js**:
|
|
41
50
|
```bash
|
|
42
51
|
node -v
|
|
43
52
|
```
|
|
44
|
-
2. **Verify npm
|
|
53
|
+
2. **Verify npm**:
|
|
45
54
|
```bash
|
|
46
55
|
npm -v
|
|
47
56
|
```
|
|
48
|
-
3. **Verify npx
|
|
57
|
+
3. **Verify npx**:
|
|
49
58
|
```bash
|
|
50
59
|
npx -v
|
|
51
60
|
```
|
|
52
61
|
|
|
53
62
|
---
|
|
54
63
|
|
|
55
|
-
##
|
|
56
|
-
|
|
57
|
-
Follow these steps to set up and run Hacker Lobby locally:
|
|
58
|
-
|
|
59
|
-
### 1. Install Dependencies
|
|
60
|
-
Clone the repository, navigate to the folder, and run:
|
|
61
|
-
```bash
|
|
62
|
-
npm install
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### 2. Configure Backend Database
|
|
66
|
-
Initialize the local Cloudflare D1 database and apply the SQL schema:
|
|
67
|
-
```bash
|
|
68
|
-
npx wrangler d1 execute chat-db --local --file=schema.sql
|
|
69
|
-
```
|
|
64
|
+
## 🚀 How to Access Hacker Lobby
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
Start the local serverless backend with Wrangler:
|
|
73
|
-
```bash
|
|
74
|
-
npx wrangler dev
|
|
75
|
-
```
|
|
76
|
-
The server will start listening at `http://127.0.0.1:8787`.
|
|
66
|
+
You can connect to the global chat room instantly using `npx`. There is no need to clone the repository or set up a local server.
|
|
77
67
|
|
|
78
|
-
|
|
79
|
-
Configure the client to connect to your local backend server using environment variables:
|
|
68
|
+
Run one of the following commands in your terminal, which configures the `API_URL` environment variable to point to the global server and launches the client:
|
|
80
69
|
|
|
81
70
|
* **PowerShell (Windows)**:
|
|
82
71
|
```powershell
|
|
83
|
-
$env:API_URL="
|
|
72
|
+
$env:API_URL="https://hacker-lobby-backend.spidozx.workers.dev"; npx hacker-lobby
|
|
73
|
+
```
|
|
74
|
+
* **Command Prompt (Windows)**:
|
|
75
|
+
```cmd
|
|
76
|
+
set API_URL=https://hacker-lobby-backend.spidozx.workers.dev && npx hacker-lobby
|
|
84
77
|
```
|
|
85
78
|
* **macOS / Linux / Git Bash**:
|
|
86
79
|
```bash
|
|
87
|
-
API_URL="
|
|
80
|
+
API_URL="https://hacker-lobby-backend.spidozx.workers.dev" npx hacker-lobby
|
|
88
81
|
```
|
|
89
82
|
|
|
90
83
|
---
|
|
91
84
|
|
|
85
|
+
## 💬 How to Use
|
|
86
|
+
|
|
87
|
+
Once inside the lobby, you can interact with the global room:
|
|
88
|
+
|
|
89
|
+
1. **Choose an Alias**: Type your nickname and press **Enter**.
|
|
90
|
+
2. **Lock Your Alias (Optional)**: If you choose to lock your alias, you will be prompted to create a password. For security, characters are hidden as you type.
|
|
91
|
+
3. **Chatting**: Type your message and press **Enter** to broadcast it.
|
|
92
|
+
4. **Commands**:
|
|
93
|
+
* Type `/exit` or `/quit` to close the application.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
92
97
|
## ✨ Features
|
|
93
98
|
|
|
94
99
|
- **Real-Time Messaging**: Built on Server-Sent Events (SSE) for zero-latency multiplayer updates.
|
|
95
|
-
- **Secure Alias Locking**:
|
|
96
|
-
- **Input Masking**: Passwords and confirmation queries are
|
|
97
|
-
- **Anti-Spam Rate Limiting**:
|
|
98
|
-
- **
|
|
99
|
-
- **Terminal XSS Protection**: Strip ANSI escape sequences from incoming user payloads to prevent control character injection attacks.
|
|
100
|
+
- **Secure Alias Locking**: Register your nickname with a password. Passwords are salted and hashed using SHA-256 for secure database verification.
|
|
101
|
+
- **Input Masking**: Passwords and confirmation queries are hidden on the terminal screen during entry.
|
|
102
|
+
- **Anti-Spam Rate Limiting**: Token-bucket rate limiting prevents message spamming.
|
|
103
|
+
- **Terminal XSS Protection**: Filters ANSI escape sequences to prevent control character injection attacks.
|
package/package.json
CHANGED