Hello,
For the SSL part have a look at
https://github.com/zappajs/zappajs/blob/master/examples/https.coffee
Inside Zappa you can access the http(s) server using `@app`, so something
along the lines of:
fs = require 'fs'
options =
port: cfg.port
disable_io: true
https:
key: fs.readFileSync cfg.ssl_key
cert: fs.readFileSync cfg.ssl_cert
require('./zappajs') options, ->
wss = new WebSocketServer server: @app
wss.on 'connection', (wsConnect) ->
wsConnect.on 'message', (message) ->
console.log message
would be equivalent to the example you mentioned. (The `disable_io`
option will disable Socket.io, which is probably what you want when
using a different websocket lib, I assume.)
Hmm... I know I've seen requests to support other libraries than
Socket.IO in Zappa in the past. Which libs should I look into if I'm
going to spend some time on this?
This would allow people to say things like:
zappa socket:'ws', ->
@on 'foo', ->
console.log @data
with Socket.IO remaining the default for backward compatibility.
S.
--
St�phane Alnet -- Telecom Artisan. OpenSource Advocate.
Development and integration for FreeSwitch, OpenSIPS, CouchDB, Node.js.
Mobile:
+33643482771 -
http://shimaore.net/ -
https://github.com/shimaore/