我是 Ruby 新手
我正在尝试使用 wamp-client gem 建立与 crossbar.io 路由器的连接。Crossbar 具有通过 crossbar 模板(python 作为后端)创建的所有默认设置和应用程序。当我通过浏览器连接时,一切都很好,但是当我尝试通过简单地使用 ruby 时
require "wamp/client"
wamp_test = WAMP::Client.new("ws://127.0.0.1:8080")
wamp_test.open
我有一个 `handle_opening_handshake_response':未处理的打开握手响应 # (Net::WS::Error)' 错误。我知道要处理握手,我的 WAMP 路由器应该发送 HTTP 101 交换协议,但它没有这样做(在 wireshark 中看不到)。请帮帮我。
客户要求:
GET / HTTP/1.1\r\n
Upgrade: websocket\r\n
Connection: Upgrade\r\n
Sec-Websocket-Key: RggxGCwmcnVuEB08UQMCWA==\r\n
Sec-Websocket-Version: 13\r\n
Sec-Websocket-Protocol: \r\n
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\n
Accept: */*\r\n
User-Agent: Ruby\r\n
Host: localhost:8080\r\n
\r\n
Full request URI: http://localhost:8080/
HTTP request 1/1
路由器返回:
HTTP/1.1 200 OK\r\n
Server: Crossbar/0.11.1\r\n
Date: Mon, 01 Feb 2016 07:48:33 GMT\r\n
Cache-Control: max-age=43200, public\r\n
Expires: Mon, 01 Feb 2016 19:48:33 GMT\r\n
Accept-Ranges: bytes\r\n
Content-Length: 5085\r\n
Content-Type: text/html\r\n
Last-Modified: Thu, 28 Jan 2016 13:07:24 GMT\r\n
\r\n
HTTP response 1/1
Line-based text data: text/html