[英]Using event-source-polyfill on server side (node.js)
Inorder to support event streams in IE and other mobile browsers i'm attempting to use event-source-polyfill ( https://www.npmjs.com/package/event-source-polyfill ). 为了在IE和其他移动浏览器中支持事件流,我尝试使用event-source-polyfill( https://www.npmjs.com/package/event-source-polyfill )。
Can anyone please provide an example on how it could be used on a node service (or) it is just adding it via npm install and then we should be all set? 谁能提供一个示例说明如何在节点服务上使用它(或只是通过npm install添加它,然后我们就准备好了)? From the documentation it looks like there are some server side requirements ( https://www.npmjs.com/package/event-source-polyfill#server-side-requirements ) out of which the, 从文档中看,似乎有一些服务器端要求( https://www.npmjs.com/package/event-source-polyfill#server-side-requirements ),其中,
So after npm install event-source-polyfill and then completing the steps from 1,2 and 3 it would eventually work in IE is that a fair understanding. 因此,在npm之后安装event-source-polyfill,然后完成1,2和3中的步骤,它最终将在IE中工作是一种公平的理解。
您还需要将脚本添加到HTML:
<script src="eventsource.js"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.