Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foxbunny/wschat
WebSocket Chat
https://github.com/foxbunny/wschat
Last synced: 28 days ago
JSON representation
WebSocket Chat
- Host: GitHub
- URL: https://github.com/foxbunny/wschat
- Owner: foxbunny
- Created: 2020-02-16T16:09:22.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T14:54:24.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T08:18:47.110Z (6 months ago)
- Language: JavaScript
- Size: 22.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebSocket Chat
This is a simple Go program and a JavaScript web application that allows the
user to "chat" with a command line program running on the host computer.This program was developed to expose through the websocket protocol the chat
program developed for testing the [Othernet Dreamcatcher](https://othernet.is/products/dreamcatcher-3-0)
capabilities.## Message length limit
Currently, messages are limited to 47 characters. This is the number of
characters that we could reliably transmit in our trials. If you would like to
build a custom version to change the limit, you can do that by modifying the
JavaScript part of the code.## Getting the latest version
Look under [releases](https://github.com/foxbunny/wschat/releases).
## Running the server
To start the server run with:
```bash
./wschat PATH_TO_CHAT
````PATH_TO_CHAT` is full path to the Othernet chat program.
You can change the address and the port to which the server should bind by
specifying the `--addr` command line argument:```bash
./wschat --addr 0.0.0.0:3000 PATH_TO_CHAT
```## Developing
You will need both Go and NodeJS in order to develop this application. This
program uses [statik](https://github.com/rakyll/statik) to bundle the static
assets inside the binary.To build the front end, run the following command:
```bash
npm run build
```This will build the static assets and create a `dist` directory containing
the compiled bundle. It will also update the `statik` package.To build the server run the usual:
```bash
go build
```You will end up with `wschat` executable file (or `wschat.exe` on Windows) in
the project directory.## Cross-compiling for Dreamcatcher
To cross-compile, you will need to have [upx](https://upx.github.io) installed.
To cross-compile this program for the Dreamcatcher (build on a non-Dreamcatcher
machine), run the following command:```bash
GOARM=7 GOARCH=arm GOOS=linux go build -ldflags="-s -w"
```On Windows machines, the above will not work. Use this instead:
```bash
set GOARM=7
set GOARCH=arm
set GOOS=linux
go build -ldflags="-s -w"
```Once the build is done, we compress the binary using UPX:
```bash
upx --brute wschat
```