An Ejecta extension to introduce WebSocket support.
Ejecta now has native WebSocket support, so this extension is unnecessary. Proceed as you will…
EJBindingWebSocket depends on SocketRocket, so add all the files in SocketRocket/SocketRocket to the Ejecta project, followed by EJBindingWebSocket.h
and EJBindingWebSocket.m
.
Unlike Ejecta, SocketRocket requires ARC. Because of this, you will need to add the -fobjc-arc
flag to SRWebSocket.m
in Build Phases > Compile Sources.
var socket = new Ejecta.WebSocket('ws://192.168.0.2:8080')
socket.addEventListener('open', function() {})
socket.addEventListener('message', function(message) {})
socket.addEventListener('error', function(error) {})
socket.addEventListener('close', function() {})
socket.send('string')
socket.close()
Inside EJBindingWebSocket/example you will find two files. index.js
goes into your /App folder, while server.js
is run with node with a single dependency: ws.