web-socket-ruby

码农软件 · 软件分类 · WebSocket开发包 · 2019-04-18 06:29:40

软件介绍

这是 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

本文地址:https://www.codercto.com/soft/d/3822.html

XML完全探索

XML完全探索

Steven Holzner / 中国青年出版社 / 2001-10 / 89.00

《XML完全探索》是完全根据读者的需要而设计的,书中有大量实际的XML场景。是一本尽可能深入地阐述XML的书籍,与其他XML书籍不同,本书中给出了上百个示例代码,完全测试通过,可供使用。 本书将帮助您:精通所有的从XML语法到XLink、从 XPointer到XML模式的XML标准;使用XSL和XSL格式化对象;使用XML和层叠样式表;利用Java和JavaScript,使用DOM解析器和一起来看看 《XML完全探索》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具