简体   繁体   中英

Websocket-Rails and IE 8

I'm working on a real-time chat application using the websocket-rails gem and am having difficulty in getting real-time updates to happen in Internet Explorer 8.

There's an option at the bottom of the initializer that enables IE8/9 compatibility with enabling 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']

I've enabled this for development and it worked VERY sporadically and unpredictably. I was able to have a message appear once or twice but never consistently and have since not been able to recreate it again.

Does anyone have any experience with getting websocket-rails and IE to work? Thanks in advance.

You can try with WebSocketJS, a polyfill for WebSocket

I would rather use a polyfill to have a socket connection, that trying to emulate one using HTTP requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM