highcarb 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/highcarb/command.rb
CHANGED
@@ -28,6 +28,7 @@ module HighCarb
|
|
28
28
|
|
29
29
|
opt "http-port", "HTTP server port", default: 9090
|
30
30
|
opt "ws-port", "WebSockets port", default: 9091
|
31
|
+
opt "ws", "Enable/Disable WebSockets", default: true
|
31
32
|
|
32
33
|
opt "skip-libs", "Don't download vendor libraries, like Deck.js and jQuery"
|
33
34
|
|
data/lib/highcarb/services.rb
CHANGED
@@ -11,8 +11,10 @@ module HighCarb
|
|
11
11
|
|
12
12
|
def start!(command, logger, auth)
|
13
13
|
EM.run do
|
14
|
-
|
15
|
-
|
14
|
+
if command.options["ws"]
|
15
|
+
EM::WebSocket.start(host: '0.0.0.0', port: command.options["ws-port"] ) do |websocket|
|
16
|
+
WSConnection.new websocket, logger
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
20
|
Thin::Server.start(
|
data/lib/highcarb/version.rb
CHANGED
@@ -14,6 +14,11 @@ $ ->
|
|
14
14
|
# we can receive commands to change the current slide
|
15
15
|
toJson = JSON.stringify
|
16
16
|
|
17
|
+
|
18
|
+
# Don't initialize the websocket if we don't have any URL
|
19
|
+
return unless EnableWebSocketsURL
|
20
|
+
|
21
|
+
|
17
22
|
channel = new WebSocket WebSocketsURL
|
18
23
|
channel.onmessage = (msgEvent) ->
|
19
24
|
msg = JSON.parse(msgEvent.data)
|
data/resources/views/index.haml
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
%script{ src: "/assets/vendor/deck.js/extensions/hash/deck.hash.js" }
|
16
16
|
|
17
17
|
:javascript
|
18
|
+
window.EnableWebSocketsURL = #{!!options["no-ws"]};
|
18
19
|
window.WebSocketsURL = "ws://" + location.hostname + ":#{options["ws-port"].to_json}/";
|
19
20
|
|
20
21
|
= load_coffe "index"
|
data/resources/views/remote.haml
CHANGED