Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imthaghost/chatserv
IRC server written in Go!
https://github.com/imthaghost/chatserv
chat cli go golang server tcp-server
Last synced: 7 days ago
JSON representation
IRC server written in Go!
- Host: GitHub
- URL: https://github.com/imthaghost/chatserv
- Owner: imthaghost
- Created: 2020-02-18T07:52:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-08T11:31:10.000Z (over 4 years ago)
- Last Synced: 2024-06-21T03:17:51.769Z (5 months ago)
- Topics: chat, cli, go, golang, server, tcp-server
- Language: Go
- Homepage:
- Size: 9.12 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A chatserver written in GO
### 📚 Table of Contents
1. [Deliverables](#deliverables)
2. [Getting Started](#getting-started)
3. [Local Development](#local-development)## Deliverables
- [x] Single chat room
- [x] Users can connect to the server
- [x] Users can set their name
- [x] Users can send the message to the room
- [x] Users can see all other user's messages## Installation
```sh
$ go get github.com/imthaghost/chatserv
```## Getting Started
### server.go
```go
package mainimport (
"github.com/imthaghost/chatserv/server"
)func main() {
var s server.ChatServer
s = server.NewServer()
s.Listen(":3333")// start the server
s.Start()
}
```### client.go
```go
package mainimport (
"flag"
"log""github.com/imthaghost/chatserv/client"
"github.com/imthaghost/chatserv/tui"
)func main() {
address := flag.String("server", "", "Which server to connect to")flag.Parse()
client := client.NewClient()
err := client.Dial(*address)if err != nil {
log.Fatal(err)
}defer client.Close()
// start the client to listen for incoming message
go client.Start()tui.StartUi(client)
}
```### Run
```sh
# we start the irc server
$ go run server.go
# in a new termnal window we start the client
$ go run client.go --server localhost:3333
```## Demo
![Example](/docs/media/client.gif)
## Local Development
```sh
# inside github.com/imthaghost/server/ircserver
$ go run main.go
# inside github.com/imthaghost/tui/irc
$ go run main.go --server localhost:3333
```