basic-chat

command module
v0.0.0-...-c5a4a64 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

basic-chat

Simple chat server using golongpoll. Provides a single chat room with HTTP Basic Auth users.

To Build

go build basic-chat.go

To Run

./basic-chat -serve 127.0.0.1:8080 -static ./static/ -accounts "username1:password1,username2:password2,username3:password3"

Then visit http://127.0.0.1:8080 and log in using HTTP basic auth with one of the accounts.

Configuring

Configure via command-line arguments:

  • -serve specifies the address to serve HTTP.
  • -static specifies where the ./static/ directory is located for serving via HTTP. This must be relative to where the executable is run from or an absolute path..
  • -saveChatsTo is the filename to persist chats to. This way chat history is preserved across server restarts.
  • -accounts is a comma delimited list of username:password accounts. Only these users will be allowed to chat.
  • -historySize is the number of chats to retain per chat room, defaults to 250. This history is present entirely in-memory as well as persisted to disk.

Note: to add a user, simply restart with an updated -accounts param.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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