Bigchat - A not so big Chat (express-ws)

Project URL: https://bigchat.glitch.me

U want to chat with people? Well Bigchat is for you.
Bigchat is a not so big chat that you can chat on. Its simple, go to the project. Type your username and start chatting.

The chat has admin commands, only accessible by Admins.

don’t judge the design

6 Likes

Great job man, I love it :slight_smile: maybe add a “room” feature ?

Fixed bug where user joined message gets sent even if the username is longer than 20 characters.

Its great how it… Kicks anyone who tries to use admin

cool, I like it. I am willing to help you with css @LukaGamingDev

@17lwinn Didn’t kick me.

yeah, must;ve been connection issues for me

It takes like 1 minute to actually let me write something, I think you shouldn’t try to load all the 1000’s of messages simply saying Hello by lulz

image

does anyone know how to make chat commands in socket.io?

Yes… Well technically you shouldn’t send the /command to the server, you should rather detect user input and see what the user is trying to do an make that an API (either through http requests or through socket.io connection).

I could help you more later, although I gotta go make myself some dinner, haven’t eaten today :wink:

1 Like

i have tried before and it doesn’t appear to work

1 Like

Send me your discord tag in DM and I’ll contact you there after I’ve eaten :slight_smile:

2 Likes

there’s a number of ways to do it, but essentially you want to first detect that a command is being given (like how chat clients know that if the message starts with “/” and no space after, whatever comes after it is the command). i often do this detection on the client side so that if there is an error, the i can tell the user before the server tries to do any work.

i am having a hard time finding commands i’ve built (E_TOO_MANY_REPOS lol), but here is an example of using regex to filter message content URLs and keywords to trigger emoji on the client side (see this code i wrote over 6 years ago lol https://github.com/jennschiffer/skatroom/blob/master/public/js/skatroom.js#L174). you can laugh at the project name, it was an art project where we turned a gallery’s restrooms into a chatroom lol.

4 Likes

NGL the UI design looks like a modernized version of socket.io’s chat demo.

I enjoyed this talking to myself, will this become a serious project?

lol thanks for the help Jenn!

And also thanks @ihack2712 who got it working last night!

Ok I have seen some stuff and I am getting discord light/teamspeak/and socket.io vibes from this.

yeah, me too

Interesting. It looks like you kept the admin keys in an env or somewhere. Cause I tried to break into it, (Basiclly testing security)
and I found this.

        if (msg.substring(0, 7) === "/admin ") {
          adminCode = msg.substring(7);
          addMessage({ type: "info", text: "Set Code" });
          return;
        }

And searched for admin and found this

      let socket;
      let adminCode = "";
      let username = "";
      let closeReason;

So I am guessing this is TBD (To Be Done) or just pre-data. Because I see username socket, adminCode, and closeReason. So I am guessing that the admin code is somewhere in an ENV or JSON file and it is changed. I never looked through the whole script, but I think if I looked hard enough I could crack it. (Again, I am checking security.)

nice, a pen test