# Player.twitch.tv refused to connect

**URL:** <https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441>\
**Category:** API\
**Created:** [June 16, 2020, 1:59pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441 "2020-06-16T13:59:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 1:59pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/1 "2020-06-16T13:59:15Z")

</div>

Hello,

I am a streamer and I use a service to host my personal webpage with some off-stream content to my community.

Recently I stumbled up with an issue that is preventing my website to load a collection of videos that I set to be loaded as a preview of my work.

When looked upon the error, I saw the following error message:

> Refused to frame [https://player.twitch.tv/](https://player.twitch.tv/) because an ancestor violates the following Content Security Policy directive: “frame-ancestors [https://vonschappler.rf.gd](https://vonschappler.rf.gd/)”.

I already contacted my host service but they didn’t have any clues on what’s causing it, since the embeds were working before…

A copy of the same website is hosted on Github pages and it works as intended…

Could you guys offer some clues on how to make them work again, please?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 2:11pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/2 "2020-06-16T14:11:43Z")

</div>

![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/a/a98ee422fffbd252c4854b321f91e81d35005cb8.png)

Your website is not available over SSL

SSL is now required for Embeds.

see also

> **[Twitch Embedded Player Updates in 2020](https://discuss.dev.twitch.com/t/twitch-embedded-player-updates-in-2020/23956/121)**
>
> Changes are coming to Twitch embedded experiences! We’re updating the way the embedded video player is initiated so that it takes advantage of all the performance improvements we’ve made to the on-site player over the la…

> **[The great big "I'm using WIX/SomeWebsiteMaking Tool and I don't know how to...](https://discuss.dev.twitch.com/t/the-great-big-im-using-wix-somewebsitemaking-tool-and-i-dont-know-how-to-fix-my-embed-thread/26297/55)**
>
> The channel embed stopped working on our wordpress website due to the recent update. The embed used to work successfully. I’ve been using JS in Wordpress. After the update we saw the “refused to frame” error. I then updated the code to include...

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 3:28pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/3 "2020-06-16T15:28:31Z")

</div>

Ok, and when that changed? Because I remember well editing my website locally (like one month ago) and having the embeds running all right and now they don’t show locally aswell…

Now I can’t even edit my own website in a local server without having to create a localhost SSL…

That’s really bad.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 3:30pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/4 "2020-06-16T15:30:59Z")

</div>

> [@Twitch Embedded Player Updates in 2020](https://discuss.dev.twitch.com/t/twitch-embedded-player-updates-in-2020/23956/1):
>
> **Update (2020/05/13):** These changes will go into effect on **June 10, 2020** and has been announced on [this post](https://discuss.dev.twitch.com/t/twitch-embedded-player-migration-timeline-update/25588). Please review the action steps below to understand how to update your iframe and JavaScript embeds by this date.

June 10th

> [@Twitch Embedded Player Updates in 2020](https://discuss.dev.twitch.com/t/twitch-embedded-player-updates-in-2020/23956/120):
>
> ## Local development
> 
> - Use “localhost” or any IP address in the “127.0.0.1/8” range as the parent value to use either HTTP or HTTPS in local development. Any port can be used, though this does not need to be specified anywhere (80, 3000, 8100, etc)
> - Local development over other IP ranges (e.g. 192.1.1.1) must adhere to the HTTPS requirement, though a valid certificate is not required

localhost is exempt from this to allow testing/development

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 3:32pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/5 "2020-06-16T15:32:54Z")

</div>

I tried using "parent: [‘localhost’] already and it does not work here… the port i use is 81 (since 80 is already in use by other application and blocked by my local server wamp)

So this “Any port can be used” seems not to be a true statement.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 3:36pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/6 "2020-06-16T15:36:42Z")

</div>

code (same for both tests)

```
<html>
  <body>

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="test"></div>
<script type="text/javascript">
  var options = {
    width: 600,
    height: 300,
    channel: "bikeman",
    parent: ["localhost"]
  };
  var player = new Twitch.Player("test", options);
</script>

  </body>
</html>

```

Worth noting using the JS embed you can omit parent and it’ll do the math for you

localhost

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/3/35b823d7cdfc99477b9f782f9f9e9d1cc432c6fa.jpeg)

localhost:81

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/e/e40030f97e8e04f71be539e189cb386979be2180.jpeg)

Looks/tested ok here

So if it’s not working for you I’m not sure what the issue is

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 3:49pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/7 "2020-06-16T15:49:01Z")

</div>

yeah - it just won’t work here…

```auto
<script type="text/javascript">

    var options = {
        collection: "TPK8B2ug0BUaPA",
        layout: "video-with-chat",
        parent: ["localhost"]
    };

    var player = new Twitch.Player("homeVideo", options);

    player.setVolume(0.0);

</script>

```

This is my script code…

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/9/9c7951d92b5b713e0b46b3223cccd74c49e8d1a5.png)

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 3:59pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/8 "2020-06-16T15:59:03Z")

</div>

And this is the error I get:

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/c/c23aad5bd4cc7dcf76d5b1987dca60e21dbd83cc.png)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 3:59pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/9 "2020-06-16T15:59:59Z")

</div>

![Screenshot 2020-06-16 at 16.59.12](https://d2opxh93rbxzdn.cloudfront.net/original/2X/c/c0599c8a845b3edac44f23e5ad49509ead12945c.png)

Thats not localhost

Thats `http://vonschappler:81`

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 4:00pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/10 "2020-06-16T16:00:25Z")

</div>

That is an alias inside my local host.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 4:01pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/11 "2020-06-16T16:01:03Z")

</div>

Doesn’t matter if it’s an alias or not.

To browser security, thats not localhost it’s another website.

So it’s expecting a SSL Cert.

> [@von\_Schappler](#):
>
> ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/c/c23aad5bd4cc7dcf76d5b1987dca60e21dbd83cc.png)

The expected domains/protocols are listed in the error

localhost over ssl/non ssl on any port

or `https://vonschappler` (so 443)

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 4:03pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/12 "2020-06-16T16:03:05Z")

</div>

Ok so why no “lock” in here to say that localhost is “secure”?

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/2/24052652b18fc8e7ed0e4cc647c53571c43d45df.png)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 16, 2020, 4:05pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/13 "2020-06-16T16:05:36Z")

</div>

Ask chrome?

I imagine there your actual URL is

```
http://localhost:81/

```

or if it is over SSL, it doesn’t show a padlock for self signed certs?

And chrome address bar hides the protocol in use, and you are not on SSL so it doesn’t show a padlock

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/d/d57619847fd1093bbb223445c7e6d0a0914848de.png)

Mine doesn’t show secure for the explict site of `http://localhost/` and I don’t test using sign signed certs to test what chrome does on localhost with self signed certs

According to

> **[Check if a site's connection is secure - Google Chrome Help](https://support.google.com/chrome/answer/95617?hl=en-GB)**
>
> Chrome helps you browse more securely by alerting you when it detects a site that may be unsafe to visit. When a site may be unsafe, Chrome changes the icon next to the site address. In Chrome, op

> # Check if a site’s connection is secure
> 
> To see whether a website is safe to visit, you can check for security info about the site. Chrome will alert you if you can’t visit the site safely or privately.
> 
> 1. In Chrome, open a page.
> 2. To check a site’s security, to the left of the web address, look at the security status:
> 
> - ![Lock](https://d2opxh93rbxzdn.cloudfront.net/original/2X/7/702c37eb4b9d19f17dccdeee865deed7c7ada0f2.png "Lock") Secure
> - ![View site information](https://d2opxh93rbxzdn.cloudfront.net/original/2X/6/629d6ec417d07624e7b94cff61e04e7043d7c3f9.png "View site information") Info or Not secure
> - ![Dangerous|autox18](https://storage.googleapis.com/support-kms-prod/4htaqcWAgcjz2Y7iv7GA0rP0nEDBUIr9gPqZ "Dangerous") Not secure or Dangerous
> 
> 1. To see the site’s details and permissions, select the icon. You’ll see a summary of how private Chrome thinks the connection is.

---

<div class="post-metadata">

**Author:** ![von\_Schappler](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/von_schappler/32/9201_2.png) [@von\_Schappler](https://discuss.dev.twitch.com/u/von_Schappler)\
**Post date:** [June 16, 2020, 4:08pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/14 "2020-06-16T16:08:41Z")

</div>

Ok, so to install a local SSL to keep working… and move everything i have to github since that’s the only “hosting service” I can use at this moment, that is working as intented.  
 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/8/8381b818ae72707ed66f3dc319e8e6c49b54fac4.png)  
Thank you!

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 21, 2020, 11:25pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/15 "2020-06-21T23:25:35Z")

</div>

A post was merged into an existing topic: [The great big “I’m using WIX/SomeWebsiteMaking Tool and I don’t know how to fix my embed” thread](https://discuss.dev.twitch.com/t/the-great-big-im-using-wix-somewebsitemaking-tool-and-i-dont-know-how-to-fix-my-embed-thread/26297/118)

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [July 21, 2020, 11:25pm UTC](https://discuss.dev.twitch.com/t/player-twitch-tv-refused-to-connect/26441/16 "2020-07-21T23:25:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
