<commit_before>WebSocket
=========

[![Swift 2.2](https://img.shields.io/badge/Swift-2.2-orange.svg?style=flat)](https://swift.org)
[![Platform Linux](https://img.shields.io/badge/Platform-Linux-lightgray.svg?style=flat)](https://swift.org)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://tldrlegal.com/license/mit-license)
[![Slack Status](https://zewo-slackin.herokuapp.com/badge.svg)](http://slack.zewo.io)

## Installation

```swift
import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/Zewo/WebSocket.git", majorVersion: 0, minor: 3)
    ]
)
```


## Example
```swift
    
import WebSocket
import HTTPServer
    
let webSocketServer = WebSocket.Server { webSocket in
    print("connected")
    
    webSocket.onBinary { data in
        print("data \(data)")
        try webSocket.send(data)
    }

    webSocket.onText { text in
        print("data \(text)")
        try webSocket.send(text)
    }
}


try! HTTPServer.Server(address: "127.0.0.1", port: 8180, responder: webSocketServer).start()
```

## Community
<commit_msg>update README.md edit example<commit_after>WebSocket
=========

[![Swift 2.2](https://img.shields.io/badge/Swift-2.2-orange.svg?style=flat)](https://swift.org)
[![Platform Linux](https://img.shields.io/badge/Platform-Linux-lightgray.svg?style=flat)](https://swift.org)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://tldrlegal.com/license/mit-license)
[![Slack Status](https://zewo-slackin.herokuapp.com/badge.svg)](http://slack.zewo.io)

## Installation

```swift
import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/Zewo/WebSocket.git", majorVersion: 0, minor: 3)
    ]
)
```


## Example
```swift
    
import WebSocket
import HTTPServer
    
let webSocketServer = WebSocket.Server { webSocket in
    print("connected")
    
    webSocket.onBinary { data in
        print("data \(data)")
        try webSocket.send(data)
    }

    webSocket.onText { text in
        print("data \(text)")
        try webSocket.send(text)
    }
}


try HTTPServer.Server(address: "127.0.0.1", port: 8180, responder: webSocketServer).start()
```

## Community

{'fraction_non_alphanumeric': 0.18157778757161747, 'fraction_numerical': 0.014103129131776113, 'mean_word_length': 3.7193347193347193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3536491', 'n_tokens_mistral': 836, 'n_tokens_neox': 775, 'n_words': 117}