websocket-chat

module
v0.0.0-...-4e346df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2020 License: MIT

README

websocket-chat

Websocket chat server in go

All connected clients receive text messages in json format:

{
    "text":"hello world",
    "timestamp":"2020-05-28T15:32:17.510029905Z",
    "username":"foobar"
}

Setup

  1. (Optional) Adjust server port if necessary in .env cp .env.dist .env and edit SERVER_PORT. 8080 is the default value.
  2. Run server: docker-compose up.
  3. Connect client ws://localhost:8080/websocket?username=foobar.
  4. Send json messages like {"text":"hello world"}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL