Skip to content

Realtime chat server with support for web clients (JS, WebSockets) and terminal (telnet).

Notifications You must be signed in to change notification settings

DiabeticOwl/web-chat-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Chat in Go

appPreview

Web Chat in Go is a simple chat built with the websocket protocol on the back end and a free bootstrap template on the front end.

The logic used is an implementation of the websocket package in the Go programming language with the application of hubs and clients principles to connect the server with the user in the web page.

User data is stored on a local PostgreSQL database and the entire app is ready to be hosted in the cloud.

Web Chat in Go also enables another port (6893) in which users can connect with the command "telnet" and join the group chat by identifying themselves as an already registered user or as a guest user.

Client

The client logic consists on a struct that contains information of the user connected to the application, the connection itself, the instance of the Hub it belongs and a channel that will be used to send the written message to the rest of clients in the program.

Hub

The hub logic consists on a struct that contains a collection of clients, a channel that will be used to broadcast all the messages sent to it to the rest of clients and two channels, one for the registration of clients and the other for the unregistration of them.

About

Realtime chat server with support for web clients (JS, WebSockets) and terminal (telnet).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published