Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframe blocked #423

Closed
gogo6211 opened this issue Dec 4, 2024 · 6 comments
Closed

Iframe blocked #423

gogo6211 opened this issue Dec 4, 2024 · 6 comments
Labels
question Question that is most likely asked often

Comments

@gogo6211
Copy link

gogo6211 commented Dec 4, 2024

I am hosting for free at Koyeb and am going to iframe the long free subdomain URL into my games website but Iframes are blocked in some way (snippet probably encoded) and I am hoping a dev can point me to where it is hidden within the code. Already spent about 1 hour searching for anything related to iframes, base64, etc., and couldn't find anything relating to it besides stuff in the Ultraviolet or Rammerhead folders (which I am 99% sure aren't causing this as the home page of hu I am hosting won't iframe).
*edit I am using 6.3 production btw and just finished briefly skimming all the files and didn't find anything :(

@QuiteAFancyEmerald
Copy link
Owner

You can't iframe crossorigin sites hosted on a domain like Koyeb (they have that disabled); a common internet practice used on the majority of sites so no place for that. You could host it yourself where you can manage the headers to allow crossorigin iframe usage or iframe one of the official domains (well I believe I have that disabled as well)

@QuiteAFancyEmerald QuiteAFancyEmerald added the question Question that is most likely asked often label Dec 5, 2024
@QuiteAFancyEmerald
Copy link
Owner

Actually I flat out lied perhaps this is allowed on Koyeb as a subdomain. Try this first:

app.register(fastifyHelmet, {

Edit this function here that utilizes helmet to apply/remove those headers preventing it from being iframed.

app.register(fastifyHelmet, {
  contentSecurityPolicy: {
    directives: {
      defaultSrc: ["'self'"],
      frameAncestors: ["*"], 
    },
  },
  xFrameOptions: false, 
  xPoweredBy: false,
});

@gogo6211
Copy link
Author

gogo6211 commented Dec 5, 2024

Thanks that worked

@ItysCrafted
Copy link

how do I edit it? please bro i need this

@gogo6211
Copy link
Author

gogo6211 commented Dec 6, 2024

how do I edit it? please bro i need this

Fork it then edit line 111 with the snipit above in src/server.mjs in a ide (vs code web works with github remote repo) then deploy your fork to koyeb. If you still don't get it ask chatgpt for help. :)

@ItysCrafted
Copy link

ItysCrafted commented Dec 6, 2024

can i have the github link to yours so I can simply fork that? i tried and it didn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question that is most likely asked often
Projects
None yet
Development

No branches or pull requests

3 participants