Skip to content

Commit 2f819ac

Browse files
committed
updated README.md
1 parent d283403 commit 2f819ac

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ The plugin for Cordova 2.x, [see here](https://github.com/knowledgecode/WebSocke
2929

3030
## Installing
3131
Use Cordova Command-Line Interface (CLI) :
32-
```shell
32+
```sh
3333
$ cordova plugin add com.knowledgecode.cordova.websocket
3434
```
3535
or
36-
```shell
36+
```sh
3737
$ cordova plugin add https://github.com/knowledgecode/WebSocket-for-Android.git
3838
```
3939
If you are developing the iOS version in parallel, this plugin will be also installed there:
40-
```shell
40+
```sh
4141
$ cordova plugin add com.knowledgecode.cordova.websocket
4242
Fetching plugin "com.knowledgecode.cordova.websocket" via plugin registry
4343
Installing "com.knowledgecode.cordova.websocket" for android
4444
Installing "com.knowledgecode.cordova.websocket" for ios
4545
```
4646
This is a feature of CLI. There are no tangible ill effects. If you want to avoid this thing, use Cordova Plugman:
4747

48-
```shell
48+
```sh
4949
$ plugman install --platform android --project ./platforms/android --plugins_dir ./plugins --plugin com.knowledgecode.cordova.websocket
5050
Fetching plugin "com.knowledgecode.cordova.websocket" via plugin registry
5151
npm http GET http://registry.cordova.io/com.knowledgecode.cordova.websocket
@@ -54,17 +54,17 @@ Installing "com.knowledgecode.cordova.websocket" for android
5454
```
5555
### Upgrading from previous versions
5656
Just remove and reinstall:
57-
```shell
57+
```sh
5858
$ cordova plugin remove com.knowledgecode.cordova.websocket
5959
$ cordova plugin add com.knowledgecode.cordova.websocket
6060
```
6161
or
62-
```shell
62+
```sh
6363
$ cordova plugin remove com.knowledgecode.cordova.websocket
6464
$ cordova plugin add https://github.com/knowledgecode/WebSocket-for-Android.git
6565
```
6666
or
67-
```shell
67+
```sh
6868
$ plugman uninstall --platform android --project ./platforms/android --plugins_dir ./plugins --plugin com.knowledgecode.cordova.websocket
6969
$ plugman install --platform android --project ./platforms/android --plugins_dir ./plugins --plugin com.knowledgecode.cordova.websocket
7070
```
@@ -78,7 +78,7 @@ When install this plugin, it adds `INTERNET` permission to `AndroidManifest.xml`
7878
### *WebSocket(url[, protocols])*
7979
The WebSocket(url, protocols) constructor takes one or two arguments. The first argument, url, specifies the URL to which to connect. The second, protocols, is either a string or an array of strings.
8080
A simple code is as follows:
81-
```JavaScript
81+
```javascript
8282
document.addEventListener('deviceready', function () {
8383
var ws = new WebSocket('ws://echo.websocket.org');
8484

@@ -113,7 +113,7 @@ This plugin has the following options. All these parameters are optional. Of cou
113113
`origin` is a value to set the request header field. `maxConnectTime` is time to wait for connection. `override` is a flag to override the native WebSocket on Android 4.4 or later devices. Set to true if want to force them to use the plugin. In most cases, it is slower than the native WebSocket.
114114

115115
If want to change these parameters, need to do before creating a instance:
116-
```JavaScript
116+
```javascript
117117
WebSocket.pluginOptions = {
118118
origin: 'http://example.com',
119119
maxConnectTime: 5000,
@@ -134,6 +134,7 @@ Closes the WebSocket connection or connection attempt, if any.
134134
## Change Log
135135
#### 0.8.1
136136
* fixed frame aggregation error (thanks to @Atsyn)
137+
* fixed binary transmission for the case of using the plugin on 4.4 or later
137138

138139
#### 0.8.0
139140
* performance tuning (about 5% to 15% faster than previous versions)

0 commit comments

Comments
 (0)