# luvit-websocket

> WebSocket API for luvit

Latest version **0.0.1-c** (published 2014-09-18) · APACHE2 license · 0 weekly downloads

## Install

```sh
npm install luvit-websocket
pnpm add luvit-websocket
yarn add luvit-websocket
bun add luvit-websocket
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-c |
| Published | 2014-09-18 |
| First published | 2014-09-17 |
| Weekly downloads | 0 |
| License | APACHE2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Niklas Kühtmann |
| Maintainers | ized |
| Keywords | luvit, utils, api, websocket, socket |

## Links

- npm: https://www.npmjs.com/package/luvit-websocket
- Repository: https://github.com/b42-coding/luvit-websocket
- Homepage: http://b42.in/
- Issues: https://github.com/b42-coding/luvit-websocket/issues
- npm.io page: https://npm.io/package/luvit-websocket

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.1-c (latest) — 2014-09-18
- 0.0.1-b — 2014-09-18
- 0.0.1-a — 2014-09-17
- 0.0.1 — 2014-09-17

## README

luvit-websocket
===============

Websocket Library for Luvit.io.

Server works, client is still a WIP.

In the current version luvit-websocket only supports the websocket standard [RFC 6455](http://tools.ietf.org/html/rfc6455),
thus it will only be able to handle connections from Chrome 16, Firefox 11, IE 10 and above.

Also it does not yet support Message Fragmentation.

Besides that, using a simple WebSocket connection in a moden browser should work fine.

Installation:
============
You can use [npm](https://www.npmjs.org/) to install luvit-websocket:
> npm install luvit-websocket

Usage:
============
```lua
  local WebSocket = require('luvit-websocket')

  local WS = WebSocket.server(1734)

  WS:on('connect', function(client)
      print("Client connected.")
      client:send("random message")
  end)

  WS:on('data', function(client, message)
      print(message)
  end)

  WS:on('disconnect', function(client)
      print("Client disconnected.")
  end)

```

---
_Source: https://npm.io/package/luvit-websocket · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
