# Recent change: open proxy deprecation

**URL:** <https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921>\
**Category:** Updates\
**Created:** [July 26, 2021, 4:32pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921 "2021-07-26T16:32:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [July 26, 2021, 4:32pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/1 "2021-07-26T16:32:26Z")

</div>

As part of our ethos to build a better web, our team always strive to do what’s best for both our service and others. Therefore, Netlify have recently deprecated the ability to create open proxies.

What is an open proxy, I hear you ask, and what’s (possibly) so bad about them? Well, rather than reinvent the wheel, [here’s the Wikipedia definition](https://en.wikipedia.org/wiki/Open_proxy)!

## Who is impacted?

Odds are, you are not impacted. We identified only a few dozen customers who had configured an open proxy, whether intentionally or by accident. All customers with an open proxy configured, and a custom domain, have already been contacted directly.

To clarify, this blog post details how an open proxy at Netlify looks, and this is the behaviour which will be deprecated: [https://blog.jim-nielsen.com/2020/a-cors-proxy-with-netlify/](https://blog.jim-nielsen.com/2020/a-cors-proxy-with-netlify/)

An open proxy redirect rule allows for a URL to be passed through as part of a path, such as:

`/proxy/* :splat 200`

## How to mitigate

Proxying to external services, [like this](https://docs.netlify.com/routing/redirects/rewrites-proxies/#proxy-to-another-service) – using a rule such as `/proxy/* https://api.example.com/:splat 200` – is **still permitted** and this behaviour is not impacted.

As always, if you have questions, please do reach out 👇 in the comments!

---

<div class="post-metadata">

**Author:** ![jimniels](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jimniels/32/1165_2.png) [@jimniels](https://answers.netlify.com/u/jimniels)\
**Post date:** [October 27, 2021, 7:52pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/5 "2021-10-27T19:52:10Z")

</div>

👋 author of the post specifically called out above.

I noticed that this functionality all of the sudden stopped working and was [wondering why](https://answers.netlify.com/t/rewrite-returning-a-500-in-production-but-a-200-on-localhost-with-netlify-dev/46357).

> [@Scott](#):
>
> We identified only a few dozen customers who had configured an open proxy, whether intentionally or by accident. All customers with an open proxy configured, and a custom domain, have already been contacted directly.

I never heard from anyone at Netlify about this. Was there any kind of communication suggesting a better workarounds to this?

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [October 29, 2021, 3:55pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/8 "2021-10-29T15:55:44Z")

</div>

Hi there, @jimniels 👋

Thanks so much for reaching out. My apologies for the suboptimal experience here. Our team sent our communication with the above information to customers who were impacted via email, but it appears as though we did not send one to you. My apologies for the oversight-- I have shared this feedback with my team.

If you have any further questions at this time, I would be happy to answer them or loop in someone else who can.

---

<div class="post-metadata">

**Author:** ![jimniels](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jimniels/32/1165_2.png) [@jimniels](https://answers.netlify.com/u/jimniels)\
**Post date:** [October 29, 2021, 5:01pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/10 "2021-10-29T17:01:39Z")

</div>

@hillary Mostly I was wondering if the “communication” that was sent was merely a deprecation notice? Or did it have additional information as to suggested workaround(s) for the deprecation?

If it had suggested workarounds, I’d love to hear them if you could find and forward me that comm? Otherwise, at least I know about the deprecation now and will have to try and figure out something on my own.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [October 29, 2021, 5:04pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/11 "2021-10-29T17:04:50Z")

</div>

Hi @jimniels,

This was the workaround shared in one the communications we had:

> [@How to create proxy on Netlify functions?](https://answers.netlify.com/t/how-to-create-proxy-on-netlify-functions/22183/):
>
> I would like to build a website. Due to the CORS problem I would need a proxy for all my requests. I would like to use Netlify Functions as the proxy. Instead of writing several Netlify Functions that make requests to different servers, I would like to create a Netlify Functions that serves as a proxy and make all requests using that proxy Netlify Functions. I’d like to know if there are some Netlify Functions sample code that serves as proxy? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jimniels](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jimniels/32/1165_2.png) [@jimniels](https://answers.netlify.com/u/jimniels)\
**Post date:** [October 30, 2021, 4:04am UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/12 "2021-10-30T04:04:50Z")

</div>

Thanks for sharing.

FWIW: my use case is a bit more sophisticated, because I want the serverless function to basically proxy back _anything_ requested: text, images, etc.

The previous solution using Netlify’s rewrite/redirects engine handled this very elegantly:

`/proxy/* :splat 200` would proxy a request for anything right back to me. I could ask for anything—PNG, JSON, HTML—and it was _almost_ like I was querying the resource itself.

But using a serverless function requires me to have to think about this all a bit more and be more explicit. At least that’s what I’m finding.

For anyone coming across this thread, this is (in essence) the hacked together method I’m trying now:

```auto
exports.handler = async function (event, context) {

  // Get the `url` from the `event`

  return fetch(url).then((res) => {
      // If content is "image/*" return the image
      const contentType = res.headers.get("content-type");
      if (contentType.startsWith("image")) {
        return res.buffer().then((img) => ({
          statusCode: 200,
          body: img.toString("base64"),
          isBase64Encoded: true,
          headers: {
            "Content-type": contentType,
          },
        }));
      }

      // Otherwise guess that you want text
      return res.text().then((body) => ({
        statusCode: 200,
        body,
      }));
    });
};

```

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [October 30, 2021, 8:47am UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/13 "2021-10-30T08:47:20Z")

</div>

> [@jimniels](#):
>
> I could ask for anything—PNG, JSON, HTML—and it was _almost_ like I was querying the resource itself.

Which is exactly why it was discontinued as it could have been easily abused by anyone to bypass CORS restrictions set by a server. It’s probably still possible, but we wanted to avoid letting anyone do it using our systems as it’s our systems that would take the impact.

---

<div class="post-metadata">

**Author:** ![jimniels](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jimniels/32/1165_2.png) [@jimniels](https://answers.netlify.com/u/jimniels)\
**Post date:** [October 30, 2021, 2:00pm UTC](https://answers.netlify.com/t/recent-change-open-proxy-deprecation/39921/14 "2021-10-30T14:00:10Z")

</div>

Makes perfect sense. The power of the thing was also its weakness 🙂

Thanks for the context—and I’m glad I found this thread and got to the root of the problem I was seeing. Thanks!
