<commit_before>socket.io
=========

#### Sockets for the rest of us

The `socket.io` client is basically a simple HTTP Socket interface implementation.
It looks similar to WebSocket while providing additional features and
leveraging other transports when WebSocket is not supported by the user's
browser.

**Note:** this is the documentation for the upcoming release **0.7**. The latest
stable version is [0.6](https://github.com/LearnBoost/Socket.IO/tree/06).

```js
var socket = io.connect('http://domain.com');
socket.on('connect', function () {
  // socket connected
});
socket.on('custom event', function () {
  // server emitted a custom event
});
socket.on('disconnect', function () {
  // socket disconnected
});
socket.send('hi there');
```

### Recipes

#### Utilizing namespaces (ie: multiple sockets)

If you want to namespace all the messages and events emitted to a particular
endpoint, simply specify it as part of the `connect` uri:

```js
var chat = io.connect('http://localhost/chat');
chat.on('connect', function () {
  // chat socket connected
});

var news = io.connect('/news'); // io.connect auto-detects host
chat.on('connect', function () {
  // news socket connected
});
```

#### Emitting custom events

To ease with the creation of applications, you can emit custom events outside
of the global `message` event.

```js
var socket = io.connect();
socket.emit('server custom event', { my: 'data' });
```

#### Forcing disconnection

```js
var socket = io.connect();
socket.on('connect', function () {
  socket.disconnect();
});
```<commit_msg>Fix minor type in README.md.<commit_after>socket.io
=========

#### Sockets for the rest of us

The `socket.io` client is basically a simple HTTP Socket interface implementation.
It looks similar to WebSocket while providing additional features and
leveraging other transports when WebSocket is not supported by the user's
browser.

**Note:** this is the documentation for the upcoming release **0.7**. The latest
stable version is [0.6](https://github.com/LearnBoost/Socket.IO/tree/06).

```js
var socket = io.connect('http://domain.com');
socket.on('connect', function () {
  // socket connected
});
socket.on('custom event', function () {
  // server emitted a custom event
});
socket.on('disconnect', function () {
  // socket disconnected
});
socket.send('hi there');
```

### Recipes

#### Utilizing namespaces (ie: multiple sockets)

If you want to namespace all the messages and events emitted to a particular
endpoint, simply specify it as part of the `connect` uri:

```js
var chat = io.connect('http://localhost/chat');
chat.on('connect', function () {
  // chat socket connected
});

var news = io.connect('/news'); // io.connect auto-detects host
news.on('connect', function () {
  // news socket connected
});
```

#### Emitting custom events

To ease with the creation of applications, you can emit custom events outside
of the global `message` event.

```js
var socket = io.connect();
socket.emit('server custom event', { my: 'data' });
```

#### Forcing disconnection

```js
var socket = io.connect();
socket.on('connect', function () {
  socket.disconnect();
});
```
{'fraction_non_alphanumeric': 0.1535045987947986, 'fraction_numerical': 0.003805899143672693, 'mean_word_length': 4.466204506065858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3968900', 'n_tokens_mistral': 906, 'n_tokens_neox': 871, 'n_words': 338}