1.0.1 • Published 2 years ago
tiws v1.0.1
tiws: a Titanium WebSocket library
Pure JavaScript based WebSocket client implementation for Titanium using Ti.Network.Socket.TCP. Can be used as a repalcement for ws on Titanium.
Install
npm i tiwsyarn add tiwsUsage
const WebSocket = require('tiws');
const ws = new WebSocket('ws://www.host.com/path');
ws.on('open', function open() {
ws.send('something');
});
ws.on('message', function incoming(data) {
console.log(data);
});For more example see the usage examples of the original ws module.
Known Limitations
This module is heavily inspired by ws but is missing a few features since Titanium is not a full NodeJS compatible enviornment.
tiwsonly works as a WebSocket client.WebSocket.Serverfunctionaily was not ported yet.- No support for secure WebSocket connections (
wss:) yet. If you need this head over to titanium_mobile#11137 and upvote that issue so it receives more visibility. - Extended payload length of 64-bit integer not supported yet.
PerMessageDeflateextensions is not supported. There is no zip implementation available in Titanium to handle the (de)compression.