<commit_before>ReWebSocket
===========
A simple JavaScript WebSocket API wrapper with automatic reconnect function if the connection is down.

ReWebSocket is fully API compatible. You just need to replace
```javascript
var ws = new WebSocket(url, protocol);
```
with
```javascript
var ws = new ReWebSocket(url, protocol, options);
```

Installation
------------
Include the javascript, and you're done!
```html
<script src="rewebsocket.min.js"></script>
```

Initialization
--------------
```javascript
var ws = new ReWebSocket(url, protocol, options);
```

#### `url`
- The URL to which to connect

#### `protocols` (optional)
- Either a single protocol string or an array of protocol strings. These strings are used to indicate WebSocket sub-protocols.

#### `options` (optional)
- Options (see below)

Options
-------
#### `debug`
- Whether to log debug messages. Debug messages are printed using `console.debug()`.
- Boolean. Default: `false`

#### `reconnect`
- Whether to implement automatic reconnect if the connection is down.
- Boolean. Default: `true`

#### `interval`
- The number of milliseconds to delay before attempting to reconnect.
- Integer. Default: `2000`

#### `maxAttempts`
- The number of maximum reconnection attempts that will be made before giving up.
- Integer. Default: `0` (`0` = unlimited)

#### `useOfflinejs`
Each browsers has its own behaviour to handle WebSocket `onclose` event. Some of them take a long time (or even never) to trigger `onclose` event since the connection was down.

- Whether to use Offline.js to monitor connection status.
- Boolean. Default: `false`

Properties
------
ReWebSocket has similar properties to WebSocket.
- `readyState`
- `binaryType`

Methods
------
ReWebSocket has similar methods to WebSocket.
- `send()`
- `close()`
Additional methods:
- `open()`: Manually open WebSocket connection if the connection is fully closed.

Events
------
ReWebSocket has similar events to WebSocket.
- `onopen`
- `onmessage`
- `onerror`
- `onclose`
Additional events:
- `onreopen`: Triggered when trying to reopen WebSocket connection if the maximum reconnection attempts has not reached yet.
- `onstop`: Triggered when user manually close the WebSocket connection, or maximum reconnection attempts has reached.
<commit_msg>Fix typo.<commit_after>ReWebSocket
===========
A simple JavaScript WebSocket API wrapper with automatic reconnect function if the connection is down.

ReWebSocket is fully API compatible. You just need to replace
```javascript
var ws = new WebSocket(url, protocols);
```
with
```javascript
var ws = new ReWebSocket(url, protocols, options);
```

Installation
------------
Include the javascript, and you're done!
```html
<script src="rewebsocket.min.js"></script>
```

Initialization
--------------
```javascript
var ws = new ReWebSocket(url, protocol, options);
```

#### `url`
- The URL to which to connect

#### `protocols` (optional)
- Either a single protocol string or an array of protocol strings. These strings are used to indicate WebSocket sub-protocols.

#### `options` (optional)
- Options (see below)

Options
-------
#### `debug`
- Whether to log debug messages. Debug messages are printed using `console.debug()`.
- Boolean. Default: `false`

#### `reconnect`
- Whether to implement automatic reconnect if the connection is down.
- Boolean. Default: `true`

#### `interval`
- The number of milliseconds to delay before attempting to reconnect.
- Integer. Default: `2000`

#### `maxAttempts`
- The number of maximum reconnection attempts that will be made before giving up.
- Integer. Default: `0` (`0` = unlimited)

#### `useOfflinejs`
Each browsers has its own behaviour to handle WebSocket `onclose` event. Some of them take a long time (or even never) to trigger `onclose` event since the connection was down.

- Whether to use Offline.js to monitor connection status.
- Boolean. Default: `false`

Properties
------
ReWebSocket has similar properties to WebSocket.
- `readyState`
- `binaryType`

Methods
------
ReWebSocket has similar methods to WebSocket.
- `send()`
- `close()`

Additional methods:
- `open()`: Manually open WebSocket connection if the connection is fully closed.

Events
------
ReWebSocket has similar events to WebSocket.
- `onopen`
- `onmessage`
- `onerror`
- `onclose`

Additional events:
- `onreopen`: Triggered when trying to reopen WebSocket connection if the maximum reconnection attempts has not reached yet.
- `onstop`: Triggered when user manually close the WebSocket connection, or maximum reconnection attempts has reached.

{'fraction_non_alphanumeric': 0.12642919964819702, 'fraction_numerical': 0.002638522427440633, 'mean_word_length': 4.163450624290579, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6658766', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1210, 'n_words': 545}