https://github.com/deven96/gosock
A foray into sockets using golang
https://github.com/deven96/gosock
golang golang-application websocket-chat websockets
Last synced: about 2 months ago
JSON representation
A foray into sockets using golang
- Host: GitHub
- URL: https://github.com/deven96/gosock
- Owner: deven96
- License: mit
- Created: 2019-05-01T10:48:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-22T15:49:54.000Z (over 5 years ago)
- Last Synced: 2025-03-24T04:02:05.109Z (about 2 months ago)
- Topics: golang, golang-application, websocket-chat, websockets
- Language: Go
- Size: 7.64 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoSOCK
This is a basic implementation of a chatroom using websockets.
Embedded in this project is also a [custom logging library](pkg/custlog/)[](https://travis-ci.org/deven96/gosock)
## Overview [](https://godoc.org/github.com/deven96/gosock)
## Install
```bash
go get github.com/deven96/gosock
```## Usage
To use the logging library, call this snippet preferably in the init
```golang
import (
"github.com/deven96/gosock/pkg/custlog"
)
func init() {
// name the log file "test.log" and write to it in append mode
def_writers := custlog.DefaultWriters("test.log", true)
custlog.LogInit(def_writers)
}func main(){
custlog.Info.Println("This is just information")
custlog.Warning.Println("This is just a warning")
custlog.Error.Println("This is just an error")
}
```To run the project,
```bash
cd $GOPATH/github.com/deven96/gosock
# run the project in develop mode
go run *.go# generate executable for current os
go build github.com/deven96/gosock# run the executable
./gosock
```For using the binaries only, read [Binaries usage](assets/extra/usage.md)
## Example Interaction

## TODO
- [ ] Incorporate a standard Golang ORM
- [ ] Include User and Message models
- [ ] Extend chat interface to include login and signup
- [ ] Include face avatar on every message
- [ ] Create a Rudeness API that can detect how unsensitive a statement is
- [ ] Kick avatar out after every 3 overly rude messages
- [ ] Deploy on Linode server
- [ ] Linode deploy should be linked to Travis pipeline## License (MIT)
This project is opened under the [MIT 2.0 License](https://github.com/deven96/gosock/blob/master/LICENSE) which allows very broad use for both academic and commercial purposes.