Sha256: b7854587c21205b0aa0466c955ce77a3b6073c1390609713c0bf897a0de4e16a
Contents?: true
Size: 518 Bytes
Versions: 8
Compression:
Stored size: 518 Bytes
Contents
#!/usr/bin/env -S falcon serve --bind http://localhost:7070 --count 1 -c require 'async/websocket/adapters/rack' require 'set' $connections = Set.new run lambda {|env| Async::WebSocket::Adapters::Rack.open(env, protocols: ['ws']) do |connection| $connections << connection begin while message = connection.read $connections.each do |connection| connection.write(message) connection.flush end end ensure $connections.delete(connection) end end or [200, {}, ["Hello World"]] }
Version data entries
8 entries across 8 versions & 1 rubygems