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

史玉柱自述

史玉柱自述

优米网 / 同心出版社 / 2013-6-1 / 42.00元

史玉柱迄今为止唯一公开著作。 亲口讲述24年创业历程与营销心得。 中国商业思想史里程碑之作! 24年跌宕起伏,功成身退,史玉柱向您娓娓道来,历经时间沉淀的商业智慧和人生感悟。 在书中,史玉柱毫无保留地回顾了创业以来的经历和各阶段的思考。全书没有深奥的理论,铅华洗尽、朴实无华,往往在轻描淡写之间,一语道破营销的本质。 关于产品开发、营销传播、广告投放、团队管理、创业投资......一起来看看 《史玉柱自述》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具