部署 faye/websocket 和 sinatra 是监听一个端口吗?

yakczh · February 04, 2014 · Last by assyer replied at February 05, 2014 · 3822 hits

http://mfojtik.im/ruby-websockets-on-openshift 参照这个例子写的程序 但是运行时报错 Rack::Lint::LintError: Status must be >=100 seen as integer

Listening on 0.0.0.0:9292, CTRL+C to stop 服务是监听在 9292 端口 app.rb 中 WebSocketApp = lambda do |env|

if Faye::WebSocket.websocket?(env)

ws = Faye::WebSocket.new(env)

这段代码是根据什么来区别 页面请求和 websocket 的请求?

根据协议来的,http 请求的开头是http://而 Websocket 请求的开头是ws://

You need to Sign in before reply, if you don't have an account, please Sign up first.