New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

local-cors-proxy-encoded

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-cors-proxy-encoded

This is a fork that modifies the original [local-cors-proxy](https://github.com/garmeeh/local-cors-proxy) to accept a full URL via encoded URI.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Note

This is a fork that modifies the original local-cors-proxy to accept a full URL via encoded URI.

For example, instead of using

Local CORS Proxy

Simple proxy to bypass CORS issues. This was built as a local dev only solution to enable prototyping against existing APIs without having to worry about CORS.

This module was built to solve the issue of getting this error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disable

Getting Started

npm install -g local-cors-proxy

Simple Example

API endpoint that we want to request that has CORS issues:

https://www.yourdomain.ie/movies/list

Start Proxy:

lcp 

Then in your client code, new API endpoint using encodeURIComponent:

http://localhost:8010/https%3A%2F%2Fwww.yourdomain.ie%2Fmovies%2Flist

End result will be a request to https://www.yourdomain.ie/movies/list without the CORS issues!

Install Locally Alternatively you can install the package locally and add a script to your project:

 "scripts": {
   "proxy": "lcp"
 }

Options

OptionExampleDefault
--port80108010
--credentials(no value needed)false
--originhttp://localhost:4200*

Keywords

FAQs

Package last updated on 09 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc