A Polymer/WebComponent wrapper of WebSocket client.
-
Install the component using Bower:
$ bower install x-websocket --save
-
Import Web Components' polyfill:
<script src="bower_components/platform/platform.js"></script>
-
Import Custom Element:
<link rel="import" href="bower_components/x-websocket/dist/x-websocket.html">
-
Start using it!
<x-websocket url="ws://echo.websocket.org"></x-websocket>
| Attribute | Options | Default | Description |
|---|---|---|---|
url |
string | undefined |
WebSocket server endpoint to connect to. Usually starts with ws:// or wss://. |
json |
bool | false |
Automatically JSON-encode sent messages and JSON-decode received messages. |
jsonSend |
bool | false |
Automatically JSON-encode sent messages, even if json is false. |
jsonReceive |
bool | false |
Automatically JSON-decode recieved messages, even if json is false. |
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
For detailed changelog, check Releases.