Giter Club home page Giter Club logo

Comments (7)

JWriter20 avatar JWriter20 commented on August 17, 2024 2

@its-pablo I got the XFrame Bypass working even though it's slow. Now I have to code the browser part. I'll tell you more when I'm finished.

What did you do to fix it?

from x-frame-bypass.

6306 avatar 6306 commented on August 17, 2024 1

@its-pablo
I got the XFrame Bypass working even though it's slow.
Now I have to code the browser part. I'll tell you more when I'm finished.

from x-frame-bypass.

1UC1F3R616 avatar 1UC1F3R616 commented on August 17, 2024 1

@6306 mind sharing how, it's over a month now :D

from x-frame-bypass.

ShaneOss avatar ShaneOss commented on August 17, 2024 1

just curios with cloudflare these days could we use a cors proxy simaler to how im downloading git repost in the browser
Coudflare pages cors proxy

#51 (comment)

from x-frame-bypass.

stretch07 avatar stretch07 commented on August 17, 2024

@6306 any luck on the browser? aaronos is cool

from x-frame-bypass.

6306 avatar 6306 commented on August 17, 2024

Not that much of luck on the web browser in html. Can't get it to render the new URL in the textbox to render on the XFrame Bypass.

from x-frame-bypass.

syonfox avatar syonfox commented on August 17, 2024

just curios with cloudflare these days could we use a cors proxy simaler to how im downloading git repost in the browser

Coudflare pages cors proxy
async function handleProxyRequest(request) {

    const url = getUrlParam(request)
    console.log(`${request.method} ${url}`)

    if (!url) {
        return new Response(
            Page, // or html
            {
                headers: { "Content-Type": "text/html" },
                status: 404,
            }
        )
    } // We done if no url were not a proxy we are a alanding page

    let headers = Object.fromEntries(request.headers.entries());

    console.log("Headers: ", JSON.stringify(headers, null, 2))
    let response = await fetch(new Request(url, {
        body: request.body,
        headers: request.headers,
        method: request.method,
        redirect: "follow",
    }))
    let { readable, writable } = new TransformStream()
    response.body.pipeTo(writable)
    return new Response(
        readable,
        {
            headers: response.headers,
            status: response.status,
        }
    )
}

//FUNCTION: Extract pathname and searchParams from the request URL
function getUrlParam(request) {

    const { pathname, searchParams } = new URL(request.url);
    if (pathname.startsWith("/http")) {
        //Modify the pathname by replacing "http:/" or "https:/" with "http://" or "https://"

        return pathname
            .slice(1) // Remove the leading "/"
            .replace(/http:\/(?!\/)/, "http://") // Replace "http:/" with "http://"
            .replace(/https:\/(?!\/)/, "https://"); // Replace "https:/" with "https://"
    }
    // Check if there's a "url" parameter in the searchParams, and if it starts with "http"
    const searchParamsUrl = searchParams.get("url");
    if (searchParamsUrl?.startsWith("http")) {
        // Return the value of the "url" parameter
        return searchParamsUrl;
    }
    // If none of the conditions are met, the function returns undefined
}



export async function onRequest(c){

    return handleProxyRequest(c.request).catch(
        (err) => new Response(err.stack, { status: 500 })
    )
}

from x-frame-bypass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.