Code Monkey home page Code Monkey logo

requests-proxy's Introduction

requests-proxy

requests-proxy is a NodeJS proxy server that adds request/response headers to the proxied request.

It allow you to append/remove request and response headers as you want to.

How to use?

Just send a request to https://yourproxydomain.com/proxy and the following supported queries:

  • url (Required) - Proxy target.
    Note: URL must be encoded to work correctly
  • ignoreReqHeaders - If set, the request headers sent from browser will be ignore.
    Example: ignoreReqHeaders=true
  • followRedirect - Follow redirect if true, otherwise send raw redirect response.
    Example: followRedirect=true
  • redirectWithProxy - If set, the server will add proxy to the redirect location.
    Example: redirectWithProxy=true
  • decompress - If set, no decompress would be done. return back the non-compressed response.
    Example: decompress=true
  • appendReqHeaders - If set, these headers will be appended to the request headers.
    Note: It will override the header if it exists.
    Example: appendReqHeaders=[["referer": "https://google.com"], ["origin": "https://google.com"]]
  • appendResHeaders - If set, these headers will be appended to the response headers.
    Example: appendResHeaders=[["content-type": "text/plain"]]
  • deleteReqHeaders - If set, these headers will be removed from the request headers.
    Example: deleteReqHeaders=["origin"]
  • deleteResHeaders - If set, these headers will be removed from the response headers.
    Example: deleteResHeaders=["set-cookie"]

CORS applied to * by default, you can override it with appendReqHeaders

Install

git clone https://github.com/hoangvu12/requests-proxy
cd requests-proxy
npm install
npm start

Example

  • http://yourproxydomain.com/proxy?url=http%3A%2F%2Fgoogle.com - Google.com with CORS headers

  • http://yourproxydomain.com/proxy?url=http%3A%2F%2Fgoogle.com&appendResHeaders=[["content-type": "text/plain"]] - Request Google.com as text

  • http://yourproxydomain.com/proxy?url=http%3A%2F%2Fgoogle.com&deleteResHeaders=["set-cookie"] - Remove Google.com cookies

Similiars

Thank you

@jimmywarting - A great gist about CORS Proxies

requests-proxy's People

Contributors

hoangvu12 avatar

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.