web-socket-ruby
- 授权协议: 未知
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: https://github.com/sblackstone/web-socket-ruby
软件介绍
这是 Ruby 对 WebSocket 的实现,示例代码:
# Runs the server at port 10081. It allows connections whose origin is example.com.
server = WebSocketServer.new(:port => 10081, :accepted_domains => ["example.com"])
server.run() do |ws|
# The block is called for each connection.
# Checks requested path.
if ws.path == "/"
# Call ws.handshake() without argument first.
ws.handshake()
# Receives one message from the client as String.
while data = ws.receive()
puts(data)
# Sends the message to the client.
ws.send(data)
end
else
# You can call ws.handshake() with argument to return error status.
ws.handshake("404 Not Found")
end
end
Design systems
Not all design systems are equally effective. Some can generate coherent user experiences, others produce confusing patchwork designs. Some inspire teams to contribute to them, others are neglected. S......一起来看看 《Design systems》 这本书的介绍吧!
