├── public
├── chat-log.txt
├── robots.txt
├── AdminHelp.md
├── index.html
├── client.css
├── admin.css
├── admin.html
├── admin.js
└── client.js
├── screenshots
└── Screenshot.png
├── .gitattributes
├── package.json
├── conf
└── chatbox.conf
├── LICENSE
├── .gitignore
├── wordpress
├── README.md
├── client.min.js
├── index.js
└── client.js
├── README.md
└── index.js
/public/chat-log.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow: /
3 |
--------------------------------------------------------------------------------
/screenshots/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/Chatbox/HEAD/screenshots/Screenshot.png
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "socket.io-chatbox",
3 | "version": "stable@160216",
4 | "description": "A simple chatbox using socket.io",
5 | "main": "index.js",
6 | "contributors": [
7 | {
8 | "name": "Grant Timmerman"
9 | },
10 | {
11 | "name": "ArchiTech",
12 | "website": "lifeislikeaboat.com"
13 | }
14 | ],
15 | "homepage": "https://arch1tect.github.io/Chatbox",
16 | "repository": {
17 | "type": "git",
18 | "url": "git://github.com/Arch1tect/Chatbox.git"
19 | },
20 | "license": "BSD",
21 | "dependencies": {
22 | "express": "3.4.8",
23 | "socket.io": "^1.3.7"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/conf/chatbox.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 443 ssl http2;
3 | server_name chatbox.kn007.net;
4 | include kn007_net_security.conf;
5 | location ~ ^/(admin\.html|chat-log.txt) {
6 | proxy_set_header Upgrade $http_upgrade;
7 | proxy_set_header Connection "upgrade";
8 | proxy_set_header Host $host;
9 | proxy_set_header X-Real-IP $remote_addr;
10 | proxy_http_version 1.1;
11 | proxy_pass http://127.0.0.1:2231;
12 | auth_basic "kn007's Auth System";
13 | auth_basic_user_file /usr/local/nginx/passwd_chatbox.db;
14 | }
15 | location / {
16 | proxy_set_header Upgrade $http_upgrade;
17 | proxy_set_header Connection "upgrade";
18 | proxy_set_header Host $host;
19 | proxy_set_header X-Real-IP $remote_addr;
20 | proxy_http_version 1.1;
21 | proxy_pass http://127.0.0.1:2231;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/public/AdminHelp.md:
--------------------------------------------------------------------------------
1 | Script Example
2 |
3 | //show chatbox
4 | show()
5 | //hide chatbox
6 | hide()
7 | //change page background color
8 | color('black')
9 | //make user say 'I admire you' publicly
10 | say('I admire you!')
11 | //make user type 'I love you' in his input bar(won't send)
12 | type('I love you')
13 | //make user send whatever is in his input bar publicly
14 | send()
15 | //play user join sound
16 | beep()
17 | //play new message sound
18 | newMsgBeep()
19 | //Redirect user to "www.example.com"
20 | window.location = "http://www.example.com"
21 |
22 | $.getScript("https://cdn.jsdelivr.net/jquery.jrumble/1.3/jquery.jrumble.min.js", function(data, textStatus, jqxhr) {
23 |
24 | $topbar.jrumble();
25 | $topbar.trigger('startRumble');
26 |
27 | })
28 |
29 | //Make user load a 3rd party library then use it
30 |
31 | //Any JavaScript code can be ran on user's end, don't be evil.
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 ArchITech
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Name: 92 | 93 |
94 |Last Message:
95 |Total Messages:
96 |Landing Page:
97 |Referrer:
98 |Idle Time:
99 |Join Time: 100 |
101 |IP: 102 | 103 | 104 |
105 |User-Agent:
106 |ID: " + s.id + "
"; 353 | socketInfoHTML += "URL: " + s.url + "
"; 354 | if (s.referrer) 355 | socketInfoHTML += "Referrer: " + s.referrer + "
"; 356 | socketInfoHTML += "IP: " + s.ip + "
"; 357 | socketInfoHTML += "Total Messages: " + s.msgCount + "
"; 358 | 359 | if (s.lastMsg) 360 | socketInfoHTML += "Last Message: \"" + s.lastMsg + "\"
"; 361 | 362 | socketInfoHTML += "Idle Time: " + getTimeElapsed(s.lastActive) + "
"; 363 | socketInfoHTML += "Connection Time: " + getTimeElapsed(s.joinTime) + "
"; 364 | 365 | $socketInfo.html(socketInfoHTML); 366 | $socketInfo.addClass('socketchatbox-socketdetail-each'); 367 | 368 | $socketInfo.data('id', s.id); 369 | // link jquery object with socket object 370 | s.jqueryObj = $socketInfo; 371 | $('.socketchatbox-userdetail-sockets').append($socketInfo); 372 | } 373 | 374 | // action history 375 | var $actionHistoryDiv = $('.socketchatbox-userdetail-actions'); 376 | $actionHistoryDiv.html(''); 377 | 378 | for (var i = 0; i < user.actionList.length; i++) { 379 | var action = user.actionList[i]; 380 | var $actionDiv = $(''); 381 | //new Date(Number(action.time)) // full time format 382 | var d = new Date(Number(action.time)); 383 | var str = ('0' + d.getHours()).slice(-2) + ":" + ('0' + d.getMinutes()).slice(-2) + ":" + ('0' + d.getSeconds()).slice(-2); 384 | str += "" + action.url + ""; 385 | str += "Welcome, Admin!
The Chatbox was started on "+data.chatboxUpTime + 624 | ".
There have been "+data.totalUsers + 625 | " users, " + data.totalSockets+" sockets and " + data.totalMsg + " messages.
"); 626 | $serverStatMsg.addClass('server-log-message'); 627 | 628 | $('.socketchatbox-admin-server').append($serverStatMsg); 629 | }); 630 | 631 | socket.on('server log', function (data) { 632 | var $serverLogMsg = $(''); 633 | var d = new Date(); 634 | var $timeStr = $('0){ 699 | scriptPointer--; 700 | setHistoryScript(); 701 | } 702 | 703 | }); 704 | 705 | $('.nextScript').click(function() { 706 | if(scriptPointer