# Perspective, Issues with WebSockets when embedding page as iFrame

**URL:** <https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 17, 2024, 9:25am UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374 "2024-10-17T09:25:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 9:25am UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/1 "2024-10-17T09:25:31Z")

</div>

Hello,

I have a perspective project running within an Ignition Gateway within my company's network. I have a digital signage tool which i would like to leverage this perspective project, and project it out to a display within the company. The Digital signage solution is struggling to pull through and host the perspective session. I've recently gotten websockets and HTTPS allowed on company's firewall, TLS/HTTPS is installed on the ignition gateway properly.

So i have Ignition Gateway server as ~~1.1.1.1~~ x.x.x.x  
and I have digital signage server at ~~2.2.2.2~~ y.y.y.y

When I am signed into server application, at ~~2.2.2.2~~ y.y.y.y, I add "HTML content" which points to URL **https:// ~~1.1.1.1~~ x.x.x.x/data/perspective/client/ProjectA**.

When i try to preview the page i have put together, on ~~2.2.2.2~~  
y.y.y.y, which is embedding the perspective projectA; I get the following errors:

The view on ~~2.2.2.2~~ y.y.y.y gets stuck indefinitely on this page from the ~~1.1.1.1~~ x.x.x.x Perspective project and server.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3bb287d5f4099799e9d497564b6317b8c276a686.png)

these are the web browser console errors:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/1787f714c51b4565da575b030e91a3c49b4be619.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/18884fd20b38b5ece4eee1ed69355391fa9676f9.png)

Does anyone have experience working through a problem similar to this? I am a little stuck on how to get this working.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [October 17, 2024, 12:36pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/2 "2024-10-17T12:36:12Z")

</div>

You may look at this post. Anytime I have tried using perspective as an embeded view I have needed to change stuff in the .conf file.

> [@Embed Perspective View as an IFRAME](https://forum.inductiveautomation.com/t/embed-perspective-view-as-an-iframe/46864/3):
>
> I figured this out eventually. The issue is that the two machines are on different domains and so by default they can’t exchange cookies. Because my web app was hosted on a machine on a domain named nunya.int and ignition was hosted on a domain named [nunya.com](http://nunya.com), the two pages couldn’t exchange cookies. These settings in ignition.conf fixed the issue: wrapper.java.additional.5=-Dignition.http.session.cookie.same-site.enabled=true wrapper.java.additional.6=-Dignition.http.session.cookie.same-sit…

---

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 1:17pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/3 "2024-10-17T13:17:13Z")

</div>

Thank you, Benjamin. I am going to give this a try...

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 17, 2024, 1:25pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/4 "2024-10-17T13:25:03Z")

</div>

> [@inov](#):
>
> So i have Ignition Gateway server as 1.1.1.1  
> and I have digital signage server at 2.2.2.2

Those are not [Private Network Addresses](https://en.wikipedia.org/wiki/Private_network). 1.1.1.1, for example, is owned by a partnership between Cloudflare and APNIC and, as far as I know, is a DNS server. Any standard routing configuration in your business will route 1.1.1.1 out to the Internet.

Stick to these ranges if you want to avoid problems.

| RFC 1918 name | IP address range | Classful description |
| --- | --- | --- |
| 24-bit block | 10.0.0.0 – 10.255.255.255 | single class A network |
| 20-bit block | 172.16.0.0 – 172.31.255.255 | 16 contiguous class B networks |
| 16-bit block | 192.168.0.0 – 192.168.255.255 | 256 contiguous class C networks |

I don't know if that's the whole problem but it's certainly a problem to be avoided.

---

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 1:32pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/5 "2024-10-17T13:32:41Z")

</div>

sorry i think i chose bad IP addresses as examples, i was just trying to indicate that the servers in this scenario are two seperate network locations.

I have two servers, each with their own I.P. Address. the 1.1.1.1 and 2.2.2.2 are not the actual IP addressess

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 17, 2024, 1:35pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/6 "2024-10-17T13:35:36Z")

</div>

OK. Edit the original question and use the `<del> ... </del>` syntax to make it read ~~1.1.1.1~~ x.x.x.x and ~~2.2.2.2~~ x.x.y.y or whatever (but make it clear that there's an edit).

---

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 1:40pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/7 "2024-10-17T13:40:01Z")

</div>

Done, thanks for providing the syntax to do that edit

---

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 1:46pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/8 "2024-10-17T13:46:40Z")

</div>

I have created the following simple website, to take server and web application y.y.y.y (digital signage solution) out of the equation.

```python
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Embedded Ignition Perspective Dashboard</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }
        iframe {
            border: 1px solid #ccc;
            width: 80%;
            height: 80%;
        }
    </style>
</head>
<body>
    <iframe src="https://x.x.x.x/data/perspective/client/ProjectA/" title="Ignition Perspective Dashboard"></iframe>
</body>

</html>

```

This reproduces the same issue, while instead just using a browser on my own laptop (whilst also on the same company network) from source ip address `z.z.z.z` which is serving simple page`index.html` through opera browser in my screenshot

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3f85f343aa8bf591a32f039590767694c8804a7.png)

```python
PerspectiveClient.60c16865dfd7f31a5209.js:2 WebSocket connection to 'wss://usea1svigngtw01.moog.com/system/pws/CleanRoom/3c63c14?token=ryxQxmDCh9Sw8Ar6XpUC-5NknsBiOlwp3vYUFhxEZ3A' failed: 
connect @ PerspectiveClient.60c16865dfd7f31a5209.js:2
onStateChange @ PerspectiveClient.60c16865dfd7f31a5209.js:2
ye @ mobx-5.15.7.js:15
r @ mobx-5.15.7.js:15
y @ mobx-5.15.7.js:15
(anonymous) @ mobx-5.15.7.js:15
t.runReaction @ mobx-5.15.7.js:15
qe @ mobx-5.15.7.js:15
Ue @ mobx-5.15.7.js:15
Ge @ mobx-5.15.7.js:15
ke @ mobx-5.15.7.js:15
ge @ mobx-5.15.7.js:15
ye @ mobx-5.15.7.js:15
r @ mobx-5.15.7.js:15
onHelloFulfilled @ PerspectiveClient.60c16865dfd7f31a5209.js:2
PerspectiveClient.60c16865dfd7f31a5209.js:2 store.Channel: Websocket connection closed. code=1006, wasClean=false, reason=No reason given, codeMeaning=Code not defined, codeDescription=Code out of range.

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 17, 2024, 2:18pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/9 "2024-10-17T14:18:31Z")

</div>

> [@inov](#):
>
> `Websocket connection closed.`

This almost always means some infrastructure in your network is either not compatible with websockets (older firewalls) or is trying and failing to do deep packet inspection. Escalate this to your IT folk.

---

<div class="post-metadata">

**Author:** ![inov](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@inov](https://forum.inductiveautomation.com/u/inov)\
**Post date:** [October 17, 2024, 2:25pm UTC](https://forum.inductiveautomation.com/t/perspective-issues-with-websockets-when-embedding-page-as-iframe/97374/10 "2024-10-17T14:25:41Z")

</div>

This worked after implementing the following changes to `ignition.conf` AND RESTARTING! (i forgot to restart when i first tried these changes)

```python
wrapper.java.additional.1=-Dignition.http.header.x_frame_options.enabled=false
wrapper.java.additional.2=-Dignition.http.header.x_content_type_options.enabled=false
wrapper.java.additional.3=-Dignition.http.header.x_xss_protection.enabled=false
wrapper.java.additional.4=-Dignition.http.header.referrer_policy.enabled=false
wrapper.java.additional.5=-Dignition.http.session.cookie.same-site.enabled=true
wrapper.java.additional.6=-Dignition.http.session.cookie.same-site.value=None

```
