stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Simple Chat

  • 5 Devlogs
  • 20 Total hours

A TUI-based chat client for local networks, featuring encryption and host configuration (slightly) similar to ssh

Open comments for this post

3h 41m 56s logged

Packet Types

After a (way too long) pause, I’m finally working on Simple Chat again. I’ve added a packet enum, which wraps all possible kinds of data communication.


What this means

Basically, now everything that’s being sent has the same interface: serialize and deserialize. You don’t need to worry about what is in this packet, just serialize it, encrypt it and it works.

This means handshakes aren’t loose bytes being sent between client and server and held together by pure hopes and dream (im praying somebody gets the reference), but instead a proper packet, which can also now be encrypted.

Heartbeats

Previously, there was also a big design flaw. If no message was being sent, you couldn’t tell if the others were just not sending anything or had already (uncleanly) disconnected. The TCP stream looked the same in both scenarios. Because of this, I’ve added a Packet::Heartbeat type. It contains no data, and if it gets received by any party, (almost) nothing happens. It’s sole purpose is to keep the stream alive.

Now with this, lets say we’re the server: a client doesn’t send a heartbeat twice. We now know that they’ve likely crashed or not properly disconnected in some other way. Because of this, we can now kick them instead of keeping a connection live.

0
0
6
Open comments for this post

8h 30m 35s logged

Server Rewrite!

I’ve rewritten the server using Tokio instead of Threads for improved performance and less server-side overhead.

What Tokio is

It utilizes Rust’s async implementation with futures to create a much more lightweight alternative to threads. Basically, you can summon multiple tasks and instead of them being full threads with seperate 8MB stacks and so on, they have way less context switching overhead and a much smaller stack per instance.

Other Server-Side Changes

In the initial handshake, the client provides its name to the server. If the server receives a message with the wrong name from that client, it will replace the name with the originally given one.


Encryption

I’m still working on finishing up encryption for all messages and the initial handshake.

3
1
75
Open comments for this post

2h 9m 54s logged

im almost done already what

So… it kinda works????
The client AND server, the TUI, the new message structs and all of that work now.

Changelog

  • Reworked Message Struct(s) and multiple message types (Chat, System)
  • Proper connect handshake
  • Rework server to use SystemMessages to broadcast client connect/disconnect events

What’s planned

  • A config file to store your name (~/.lan-chat)
  • Encryption (between clients)
0
0
13
Open comments for this post

1h 6m 40s logged

TUI Time! :)

The TUI works now, I only need to polish it (stuff like scrolling when message box is full)


Additonally, I’m planning to add a special kind of message that the server sends on client join/leave events.

0
0
13
Open comments for this post

4h 27m 44s logged

New Project!!

This is LAN Chat, a TUI chat messenger to use in the same LAN as others.

Build using Rust with ratatui (a TUI library)


Currently, I have a working client/server system, which sends serialized message structs. Next up, I’m gonna work on getting the TUI running.

0
0
63

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…