Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gremble0/gochat
Go multi user TCP chat server. Sister project of cchat - the client for gochat
https://github.com/gremble0/gochat
go gochannels golang network networking tcp tcp-server
Last synced: 7 days ago
JSON representation
Go multi user TCP chat server. Sister project of cchat - the client for gochat
- Host: GitHub
- URL: https://github.com/gremble0/gochat
- Owner: gremble0
- License: mit
- Created: 2023-11-02T04:34:58.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-09T05:30:45.000Z (11 months ago)
- Last Synced: 2024-06-21T18:00:41.806Z (5 months ago)
- Topics: go, gochannels, golang, network, networking, tcp, tcp-server
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-chat
This is a simple multi user chat program written in go. It has a sister project [cchat](https://github.com/gremble0/cchat) for connecting to the server.## Quick start
### Initializing database
go-chat uses a postgresql to store data. This database needs to be initialized before you can run the server. To run the database locally simply connect to the postgres service on your machine, and run the file `init_db.sql`:
```shell
$ psql -U
$ \i init_db.sql
```
This should create the database on your local machine and you are now ready to host the server.### Hosting the server
To host the server with the preconfigured defaults you can run the following command:
```shell
make run
```
If you would like to change the configuration for the server you can run the following command:
```shell
make build
```
and add any desired command line arguments to the executable. For more information on how to configure the server:
```shell
./gochat --help
```### Connecting to the server
To connect as a client you can do so with any program that allows tcp connections such as netcat, telnet or the designated [cchat](https://github.com/gremble0/cchat) client. The program is by default hosted on port 8080, so if you use netcat you could connect like this assuming the server is hosted locally:
```shell
nc 127.0.0.1 8080
```
To connect to a remote hosted gochat server simply replace the local ip address with the remote one and everything should work like normal. For instructions on how to connect with the cchat client, see the documentation on that page.