Skip to content

Commit cd0fa3c

Browse files
committed
Describe changes from upstream in README
1 parent fa3af7f commit cd0fa3c

1 file changed

Lines changed: 29 additions & 18 deletions

File tree

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Java and Android Socketcluster Client
22
=====================================
33

4+
This SocketCluster Java/Android Client fork has the following differences from upstream:
5+
- [Jackson](https://github.com/FasterXML/jackson) JSON parser is used, instead of [JSON-java](https://github.com/stleary/JSON-java)
6+
- [SocketCluster Minimal binary (sc-codec-min-bin) codec](https://github.com/SocketCluster/sc-codec-min-bin) support
7+
- Underlying [nv-websocket-client](https://github.com/TakahikoKawasaki/nv-websocket-client) has been updated to the latest version
8+
- Breaking: callback params now have Jackson `JsonNode` types, instead of upstream's `Object`
9+
10+
**Important Notes:** Due to using `jackson-databing` this library is significantly bigger in size than upstream (~2 Mb), so if binary codec support is not needed, consider using upstream instead.
11+
412
Overview
513
--------
614
This client provides following functionality
@@ -9,37 +17,26 @@ This client provides following functionality
917
- Automatic reconnection
1018
- Pub/sub
1119
- Authentication (JWT)
20+
- Binary codec support (`sc-codec-min-bin` included out-of-the-box)
1221

1322
License
1423
-------
1524
Apache License, Version 2.0
1625

1726
Gradle
1827
------
19-
For java
2028

2129
```Gradle
22-
dependencies {
23-
compile 'io.github.sac:SocketclusterClientJava:1.7.4'
30+
repositories {
31+
jcenter()
32+
maven { url "https://jitpack.io" }
2433
}
25-
```
26-
for sample java examples visit [Java Demo](https://github.com/sacOO7/socketcluster-client-testing/tree/master/src/main/java)
27-
28-
For android
29-
30-
```Gradle
31-
compile ('io.github.sac:SocketclusterClientJava:1.7.4'){
32-
exclude group :'org.json', module: 'json'
34+
dependencies {
35+
implementation 'com.github.XDex:socketcluster-client-java:2.0.0'
3336
}
3437
```
35-
for sample android demo visit [Android Demo](https://github.com/sacOO7/socketcluster-android-demo)
36-
3738

38-
[ ![Download](https://api.bintray.com/packages/sacoo7/Maven/socketcluster-client/images/download.svg) ](https://bintray.com/sacoo7/Maven/socketcluster-client/_latestVersion)
39-
40-
<!---
41-
Download [latest jar dependency](https://github.com/sacOO7/socketcluster-client-java/blob/master/out/artifacts/SocketclusterClientJava_main_jar/SocketclusterClientJava_main.jar?raw=true)
42-
-->
39+
[Download JAR](https://api.bintray.com/packages/sacoo7/Maven/socketcluster-client/images/download.svg)
4340

4441
Description
4542
-----------
@@ -194,6 +191,20 @@ The object received can be String, Boolean, Long or JSONObject.
194191

195192
```
196193

194+
Codecs
195+
------
196+
197+
Custom binary [SocketCluster codecs](https://github.com/SocketCluster/socketcluster#custom-codecs) are supported.
198+
Support for [sc-codec-min-bin](https://github.com/SocketCluster/sc-codec-min-bin) is included out-of-the-box.
199+
200+
To enable a binary codec, just set it as follows on the SocketCluster `Socket`:
201+
202+
```java
203+
socket.setCodec(new MinBinCodec());
204+
```
205+
206+
Custom binary codecs must implement the `SocketClusterCodec` interface.
207+
197208
Implementing Pub-Sub via channels
198209
---------------------------------
199210

0 commit comments

Comments
 (0)