Skip to content

michaelrhodes/EJBindingWebSocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EJBindingWebSocket

An Ejecta extension to introduce WebSocket support.

Attention

Ejecta now has native WebSocket support, so this extension is unnecessary. Proceed as you will…

Setup

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.

Usage

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()

Example

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.

About

An Ejecta extension to introduce WebSocket support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published