我正在使用websocket-rails gem开发一个实时聊天应用程序,但在Internet Explorer8中获取实时更新时遇到了困难。
在初始化器的底部有一个选项,它支持IE8/9与启用CORS的兼容性:
# Supporting HTTP streaming on Internet Explorer versions 8 & 9
# requires CORS to be enabled for GET "/websocket" request.
# List here the origin domains allowed to perform the request.
config.allowed_origins = ['http://localhost:3000']我已经将其用于开发,它的工作非常零星且不可预测。我可以让一条消息出现一到两次,但从来没有一致过,从那以后就再也不能重新创建它了。
有没有人有使用websocket-rails和IE的经验?提前谢谢。
发布于 2014-05-30 18:54:26
您可以尝试使用WebSocketJS, a polyfill for WebSocket
我宁愿使用polyfill来实现套接字连接,而不是尝试使用HTTP请求来模拟套接字连接。
https://stackoverflow.com/questions/23940253
复制相似问题