GithubHelp home page GithubHelp logo

how to about cors-proxy2 HOT 8 CLOSED

rhildred avatar rhildred commented on September 25, 2024
how to

from cors-proxy2.

Comments (8)

rhildred avatar rhildred commented on September 25, 2024

Hi:

I made this repo when I was wrestling with getting a corsProxy working with Cloudflare functions. Since I didn't delete it when the approach in this repo failed, I will update it with the working code in an hour or so.

Rich

from cors-proxy2.

rhildred avatar rhildred commented on September 25, 2024

I think that I have cleaned up now. Please test my instructions and let me know by closing the issue if you could get it to work.

from cors-proxy2.

namdevel avatar namdevel commented on September 25, 2024

can i run this code use express JS ?
i'm confused about cloudflare pages

from cors-proxy2.

rhildred avatar rhildred commented on September 25, 2024

The response is handled a little differently in express. I added a method so that cors-proxy2 can run on express or on Cloudflare pages functions. Please let me know if I have answered your question.

from cors-proxy2.

namdevel avatar namdevel commented on September 25, 2024

Cannot GET /

did you have telegram or discord ?

from cors-proxy2.

namdevel avatar namdevel commented on September 25, 2024

http://127.0.0.1:8080/corsproxy/google.com

302 Moved
The document has moved here.

how to follow redirect and display the html page

from cors-proxy2.

rhildred avatar rhildred commented on September 25, 2024

Hi:

Looks like you have it working. I guess I could follow the redirect by looking at the status code and re-doing the fetch. I could use that behavior for downloading .zips from github in a progressive web app.

I refactored cors-proxy because I found the testing server supplied with isomorphic git unreliable. I wanted to use git from within a progressive web app and on stackblitz. I reasoned that if I exported it as a Cloudflare pages function I could use it as part of my larger project diy-pwa and it would stand up when sales engineers (my target market) start really using diy-pwa.

I didn't intend for it to be an open proxy, but I left out the code from cors-proxy that restricted it to git. My intention was to put the git code back in but I didn't think that anyone would be interested in cors-proxy2 by itself and there were more pressing details. I would be interested to know about your use case for cors-proxy2. In the meantime, I will transparently follow the redirect when fetching for the downloading a .zip from github case.

Thanks

Rich (rhildred#3087 on Discord)

from cors-proxy2.

rhildred avatar rhildred commented on September 25, 2024

I created the library to run cloudflare workers and pages functions on express. It is at https://github.com/diy-pwa/cloudflare2express. I didn't write any tests yet, but if you look at the example there are 3 desk check test endpoints. I didn't get following a redirect done. Out of time for today but I am planning on cleaning up sometime soon.

from cors-proxy2.

Related Issues (1)

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.