简体   繁体   中英

Websockets not working with Powerpoint Add-in

I'm using a Microsoft add-in for Powerpoint called 'Web Viewer' (it's just an iframe, you insert a URL, it displays it in the slide ).

I inserted a webpage that uses Socket.IO , and I'm seeing it is not able to connect to the server (even the long polling it's falling back on is not working).

Clearly this is not an issue with the add-in: Any ideas what is going on here?

I tested on Mac 10.13.4 (latest) / Powerpoint (16.12, Office 365 Home) (latest).

The same webpage works in an iframe in the latest Chrome, Firefox, Safari, IE11 , so I'm thinking something wonky is going on with the embedded (Webkit) browser that Powerpoint is using on Mac.

The general request flow is:

Browser -> AWS ALB (with stickiness enabled) -> Nginx -> Node

UPDATE

Looked into this further, and having tested other pages that use Socket.IO, I think the only difference in their setups and here is the ALB.

Even with stickiness enabled, the load balancer is clearly seen (in the logs) passing traffic between all EC2s. This leads me to believe the cookie they use is either not being set or not being passed with the requests.

First of all, based on this github issue it should be possible to open a websocket.

There might be a problem with using the unsecure ws:// . I know that officejs rejects all requests to http:// and forces you to use https:// with a secure certificate. So they might do the same with WebSockets and force you to use wss:// with a valid certificate.

You can test this more easily in Power Point Online with Chrome. The addin is the same but you get much better error logging in the Devtools Console (hit F12). If it's asecurity issue there should be an error message indicating it.

I had the same issue and S.Freederle is correct. Now I'm able to use socket.io via ngrok to create a secure tunnel (HttpS) to connect to my server and emit the data to my client side in office add-in.

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