Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrudolph/pekko-http-scala-js-websocket-chat
An example app that integrates pekko-http and scala-js to implement a websocket chat
https://github.com/jrudolph/pekko-http-scala-js-websocket-chat
Last synced: 11 days ago
JSON representation
An example app that integrates pekko-http and scala-js to implement a websocket chat
- Host: GitHub
- URL: https://github.com/jrudolph/pekko-http-scala-js-websocket-chat
- Owner: jrudolph
- License: mit
- Created: 2015-04-27T14:43:34.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-10-03T08:58:12.000Z (about 1 month ago)
- Last Synced: 2024-10-14T06:09:39.660Z (24 days ago)
- Language: Scala
- Homepage:
- Size: 500 KB
- Stars: 342
- Watchers: 22
- Forks: 60
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pekko HTTP / Scala.js / Websocket Chat App
A simple chat app that uses a pekko-http backend and a scala.js frontend to implement a simple
websocket based chat application.To run:
```
sbt> project backend
> reStart
```Navigate to [http://localhost:8080/](http://localhost:8080/).
You can build a fully self-contained jar using `assembly` in the backend project.
## Configuration
You can set `app.interface` and `app.port` in `application.conf` to configure where the server
should listen to.This also works on the command line using JVM properties, e.g. using `re-start`:
```
> re-start --- -Dapp.interface=0.0.0.0 -Dapp.port=8080
```will start the server listening on all interfaces.
## CLI
The `cli` project contains a command line client for the chat to demonstrate the Websocket client and
how to deal with console input in a streaming way.![CLI Screencast](https://github.com/jrudolph/pekko-http-scala-js-websocket-chat/raw/master/docs/cli-screencast.gif)
It runs best directly from a terminal.
Start the server as explained above. Then, to build a fat jar use
```
sbt> project cli
> assembly
```Run
```
java -jar cli/target/cli.jar
```or
```
./chat
```Here's another screencast that shows live tab completion in action:
![CLI completion screencast](https://github.com/jrudolph/pekko-http-scala-js-websocket-chat/raw/master/docs/cli-completion.gif)
## Known issues
### The "frontend"
There isn't more than absolutely necessary there right now.