Skip to content

Commit

Permalink
Re-organize README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffrey Bion committed Sep 13, 2020
1 parent 65a3692 commit 546b60e
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/joffrey-bion/krossbow/blob/master/LICENSE)

A coroutine-based Kotlin multi-platform WebSocket client and [STOMP 1.2](https://stomp.github.io/index.html) client
over web sockets.

## Kotlin version compatibility

Starting at version 0.30.0, Krossbow uses Kotlin 1.4.
This library was built using Kotlin 1.3 up to version 0.21.1.
over web sockets.
This project supports the JVM and JS targets (including browser and NodeJS).

## Experimental status

***This project is experimental, meaning that there is no guarantee of backwards compatibility.***
This project is experimental, meaning that there is no guarantee of backwards compatibility.
Any part of the public API may change until version 1.0.0 is released.

This is mainly due to the fact that the project is young, but also because it has multiple dependencies on
experimental libraries like [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization) and
This is mainly due to the fact that the project is young, but also because it has dependencies on experimental
libraries like [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization) and
[Kotlinx IO](https://github.com/Kotlin/kotlinx-io).

## Supported targets
Expand Down Expand Up @@ -52,11 +48,29 @@ Additional features:

- Auto-receipts (automatically adds RECEIPT headers when appropriate to ensure no frame is lost)
- Automatic content length header for sent frames
- Built-in JSON body conversions (Kotlinx Serialization or Jackson)
- Possibility to hook custom body converters (for textual or binary bodies)
- Built-in JSON body conversions (Kotlinx Serialization or Jackson)

If you find a bug or a feature that's missing compared to the specification, please open an issue.

## Project structure

This project contains the following modules:
- `krossbow-stomp-core`: the multiplatform STOMP client to use as a STOMP library in common, JVM or JS projects. It
implements the STOMP 1.2 protocol on top of a websocket API defined by the `krossbow-websocket-core` module.
- `krossbow-stomp-jackson`: a superset of `krossbow-stomp-core` adding JSON conversion features using Jackson (JVM only)
- `krossbow-stomp-kxserialization`: a superset of `krossbow-stomp-core` adding conversion features using Kotlinx
Serialization library (multiplatform)
- `krossbow-websocket-core`: a common WebSocket API that the STOMP client relies on, to enable the use of custom
WebSocket clients. This also provides a default JS client implementations using the Browser's native WebSocket, and
a JVM 11+ implementation using the async WebSocket API.
- `krossbow-websocket-ktor`: a multiplatform `WebSocketClient` implementation based on Ktor's `HttpClient`.
- `krossbow-websocket-sockjs`: a multiplatform `WebSocketClient` implementation for use with SockJS servers. It uses
Spring's SockJSClient on JVM, and npm `sockjs-client` for JavaScript (NodeJS and browser).
- `krossbow-websocket-spring`: a JVM 8+ implementation of the web socket API using Spring's WebSocketClient. Provides
both a normal WebSocket client and a SockJS one.
- `krossbow-websocket-okhttp`: a JVM implementation of the web socket API using OkHttp's WebSocketClient.

## STOMP Usage

### Raw STOMP usage (without conversions)
Expand Down Expand Up @@ -203,7 +217,12 @@ StompClient().connect(url).withTextConversions(myConverter).use {
}
```

## Picking a web socket implementation
## Setup

Starting at version 0.30.0, Krossbow uses Kotlin 1.4.
This library was built using Kotlin 1.3 up to version 0.21.1.

### Picking a web socket implementation

The `krossbow-websocket-core` artifact defines a general web socket API, and provides basic JS/JVM implementations
without third-party dependencies.
Expand All @@ -215,15 +234,15 @@ Other artifacts provide more implementations supporting more platforms by depend
| `krossbow-websocket-sockjs` | :eight_pointed_black_star: | :eight_pointed_black_star: | :eight_pointed_black_star: | | [sockjs-client](https://github.com/sockjs/sockjs-client), [Spring websocket](https://docs.spring.io/spring-framework/docs/5.0.0.BUILD-SNAPSHOT/spring-framework-reference/html/websocket.html) |
| `krossbow-websocket-spring` | | | :white_check_mark: :eight_pointed_black_star: | | [Spring websocket](https://docs.spring.io/spring-framework/docs/5.0.0.BUILD-SNAPSHOT/spring-framework-reference/html/websocket.html) |
| `krossbow-websocket-okhttp` | | | :white_check_mark: | | [OkHttp](https://square.github.io/okhttp/) |
| `krossbow-websocket-ktor` | :white_check_mark: | :white_check_mark: | :white_check_mark: \* | | [Ktor](https://ktor.io/clients/websockets.html), and the relevant [Ktor engine(s)](https://ktor.io/clients/http-client/engines.html) |
| `krossbow-websocket-ktor` | :white_check_mark: | :white_check_mark: | :white_check_mark: \* | | [Ktor](https://ktor.io/clients/websockets.html), and the relevant [Ktor engine(s)](https://ktor.io/clients/http-client/engines.html) |

:white_check_mark: supported with native web socket transport

:eight_pointed_black_star: supported using [SockJS](https://github.com/sockjs/sockjs-client) protocol (requires a SockJS server)

\* Blocking when using OkHttp engine, but can be async with CIO engine

## Adding the dependency
### Adding the dependency

All the modules are currently published to Bintray JCenter.
They are not available on Maven Central yet because of Javadoc generation issues/Dokka misconfiguration.
Expand Down Expand Up @@ -252,24 +271,6 @@ Just add the non-suffixed version of the artifact to your `commonMain` source se
implementation("org.hildan.krossbow:krossbow-stomp-core:$krossbowVersion")
```

## Project structure

This project contains the following modules:
- `krossbow-stomp-core`: the multiplatform STOMP client to use as a STOMP library in common, JVM or JS projects. It
implements the STOMP 1.2 protocol on top of a websocket API defined by the `krossbow-websocket-core` module.
- `krossbow-stomp-jackson`: a superset of `krossbow-stomp-core` adding JSON conversion features using Jackson (JVM only)
- `krossbow-stomp-kxserialization`: a superset of `krossbow-stomp-core` adding conversion features using Kotlinx
Serialization library (multiplatform)
- `krossbow-websocket-core`: a common WebSocket API that the STOMP client relies on, to enable the use of custom
WebSocket clients. This also provides a default JS client implementations using the Browser's native WebSocket, and
a JVM 11+ implementation using the async WebSocket API.
- `krossbow-websocket-ktor`: a multiplatform `WebSocketClient` implementation based on Ktor's `HttpClient`.
- `krossbow-websocket-sockjs`: a multiplatform `WebSocketClient` implementation for use with SockJS servers. It uses
Spring's SockJSClient on JVM, and npm `sockjs-client` for JavaScript (NodeJS and browser).
- `krossbow-websocket-spring`: a JVM 8+ implementation of the web socket API using Spring's WebSocketClient. Provides
both a normal WebSocket client and a SockJS one.
- `krossbow-websocket-okhttp`: a JVM implementation of the web socket API using OkHttp's WebSocketClient.

## Contribute

Don't hesitate to open GitHub issues, even to ask questions or discuss a new feature.
Expand Down

0 comments on commit 546b60e

Please sign in to comment.