whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: change to fullchain; support wss in demo client
Date Tue, 04 Oct 2016 01:14:59 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  6c004d2   change to fullchain; support wss in demo client
6c004d2 is described below

commit 6c004d2dfd696d1eed3dee00e876768d63f7ae1f
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Oct 3 21:14:33 2016 -0400

    change to fullchain; support wss in demo client
---
 www/board/agenda/daemon/wsc.rb | 8 +++++++-
 www/board/agenda/daemon/wss.rb | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/www/board/agenda/daemon/wsc.rb b/www/board/agenda/daemon/wsc.rb
index f1f7f16..7d4bc30 100644
--- a/www/board/agenda/daemon/wsc.rb
+++ b/www/board/agenda/daemon/wsc.rb
@@ -18,6 +18,7 @@ end
 options = OpenStruct.new
 options.host = 'localhost'
 options.port = 34234
+options.protocol = 'ws'
 
 opt_parser = OptionParser.new do |opts|
   opts.banner = "Usage: #{File.basename(__FILE__)} [options]"
@@ -29,6 +30,10 @@ opt_parser = OptionParser.new do |opts|
   opts.on "-p", "--port PORT", 'Port to connect to' do |port|
     options.port = port
   end
+
+  opts.on "--secure", 'Use secure web sockets (wss)' do
+    options.protocol = 'wss'
+  end
 end
 
 opt_parser.parse!(ARGV)
@@ -37,7 +42,8 @@ opt_parser.parse!(ARGV)
 #                         Connect to WebSocket                         #
 ########################################################################
 
-ws = WebSocket::Client::Simple.connect "ws://#{options.host}:#{options.port}"
+url ="#{options.protocol}://#{options.host}:#{options.port}"
+ws = WebSocket::Client::Simple.connect url
 
 ws.on :message do |msg|
   puts msg.data
diff --git a/www/board/agenda/daemon/wss.rb b/www/board/agenda/daemon/wss.rb
index 7b39312..618d4bf 100755
--- a/www/board/agenda/daemon/wss.rb
+++ b/www/board/agenda/daemon/wss.rb
@@ -17,7 +17,7 @@ options = OpenStruct.new
 options.host = '0.0.0.0'
 options.port = 34234
 options.privkey = Dir['/etc/letsencrypt/live/*/privkey.pem'].first
-options.chain = Dir['/etc/letsencrypt/live/*/chain.pem'].first
+options.chain = Dir['/etc/letsencrypt/live/*/fullchain.pem'].first
 options.kill = false
 
 opt_parser = OptionParser.new do |opts|

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message