An open API service indexing awesome lists of open source software.

https://github.com/redraw/microchat


https://github.com/redraw/microchat

Last synced: over 1 year ago
JSON representation

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
```