# Twitch embed on local html file?

**URL:** <https://staging-discuss.dev.twitch.com/t/twitch-embed-on-local-html-file/26322>\
**Category:** API\
**Created:** [June 13, 2020, 7:39am UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-on-local-html-file/26322 "2020-06-13T07:39:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![feardragon64](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/feardragon64/32/7490_2.png) [@feardragon64](https://staging-discuss.dev.twitch.com/u/feardragon64)\
**Post date:** [June 13, 2020, 7:39am UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-on-local-html-file/26322/1 "2020-06-13T07:39:16Z")

</div>

I’m currently using a custom made html web source with a javascript embed in my stream. One part of the html web source is that I include a twitch embed but with the recent changes made to twitch embeds, this seems to no longer work. I’m not positive but I believe this is because you have to serve from https now, but my web source isn’t served from https(or http for that matter) because it’s just a local file.

Is there a way around this? I know I can theoretically spin up a simple web server that serves the html file from https but is that really the only way I can do an embed now? Here’s my code in case I’m doing something else wrong.

Console error:

 ![](https://d2spem0quai2ol.cloudfront.net/original/2X/7/738d49286dcc08a3a9e65a5239f634788f90719d.png)

```javascript
var twitch = new Twitch.Embed('twitch-feed', {
    width: "100%",
    height: "100%",
    channel: raidTarget,
    parent: ['feardragon.com'],
    layout: 'video' });

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [June 13, 2020, 8:23am UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-on-local-html-file/26322/2 "2020-06-13T08:23:58Z")

</div>

Embeds wont work when run from `file://`, you have to serve it from a webserver over HTTPS (or HTTP if you’re serving it from localhost or 127.0.0.1/8). Also setting the parent `feardragon.com` wont do anything to help, unless the browser is actually accessing that website and trying to load the embed there.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [July 17, 2020, 8:01am UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-on-local-html-file/26322/4 "2020-07-17T08:01:17Z")

</div>

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