https://github.com/redraw/microchat
https://github.com/redraw/microchat
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/redraw/microchat
- Owner: redraw
- Created: 2024-06-02T18:43:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T22:02:01.000Z (about 2 years ago)
- Last Synced: 2025-01-25T17:33:18.362Z (over 1 year ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chat
TCP chat started from [plutov/packagemain](https://github.com/plutov/packagemain)
## Install
```sh
go install github.com/redraw/microchat
```
or you can download a compiled binary from [Releases](https://github.com/redraw/microchat/releases/latest)
## Usage
```sh
Usage of ./dist/microchat:
-addr string
port to run the server on (default ":8888")
-autojoin string
channel to join
-cert string
TLS certificate file (default "server.crt")
-key string
TLS key file (default "server.key")
-mode string
mode to run the app (server or client) (default "client")
-nick string
nickname to use in chat
-skip-verify
skip TLS certificate verification on client
-tls
enable TLS
```
### Server
```sh
microchat -mode=server -addr :4321
```
You can add TLS by passing your cert .crt and .key files,
```sh
microchat -mode=server -addr :4321 -tls -cert=server.crt -key=server.key
```
Here's a handy command to generate a self-signed cert,
```sh
openssl req -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -subj "/CN=localhost"
```
### Client
```sh
microchat -addr :4321
```
You can also connect using TLS,
```sh
microchat -addr :4321 -tls
```