Sha256: cf087e4aecaf519e2c71601046f3e254574022e707a5a81f85de7b3ea19a5cc0
Contents?: true
Size: 1.08 KB
Versions: 44
Compression:
Stored size: 1.08 KB
Contents
command 'start server' do |c| c.option '--host HOSTNAME', nil, 'What hostname to listen on' c.option '--port PORT', nil, 'What port to listen on' c.action do |args, options| options.default(root: Brief.pwd, port: 9094, host: '0.0.0.0') require 'thin' require 'rack/handler/thin' require 'brief/server/gateway' require 'brief/server/socket' require 'em-websocket' fork do Brief::Server::Gateway.start(port: options.port, host: options.host, root: Pathname(options.root)) end EM.run { EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws| Brief::Server::Socket.new(root: options.root, websocket: ws) end } end end command 'start socket server' do |c| c.option '--port PORT', String, 'What port to listen on' c.action do |args, options| options.default(root: Brief.pwd, port: 5054) require 'brief/server/socket' require 'em-websocket' EM.run { EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws| Brief::Server::Socket.new(root: options.root, websocket: ws) end } end end
Version data entries
44 entries across 44 versions & 1 rubygems