---
title: "Discussion on \"How to Setup Proxy in React with http-proxy-middleware\" | Hashnode"
description: "Discussion on \"How to Setup Proxy in React with http-proxy-middleware\". A simple way to fix invalid options object error when using a proxy to your backend"
url: "https://hashnode.com/posts/how-to-setup-proxy-in-react-with-http-proxy-middleware/625ae43f2f84e0d4fc33d2d3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Setup Proxy in React with http-proxy-middleware](https://sunkanmi.hashnode.dev/how-to-setup-proxy-in-react-with-http-proxy-middleware?utm_source=hashnode&utm_medium=feed)

A simple way to fix invalid options object error when using a proxy to your backend

Apr 16, 2022 · 2 min read · sunkanmi.hashnode.dev  
Updated Dec 10, 2024  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#proxy](https://hashnode.com/tag/proxy)
-   [#http](https://hashnode.com/tag/http)
-   [#nodejs](https://hashnode.com/tag/nodejs)

## Written by

[Sunkanmi Fafowora](https://hashnode.com/@SunkanmiFafowora)

@SunkanmiFafowora · Lagos, Nigeria

  
[View profile](https://hashnode.com/@SunkanmiFafowora)

Software Engineer / Technical Writer

Lover of all things tech. I write articles on Front-end development, JavaScript, React, Python, and anything that makes my life easier. Thanks for stopping by! 😊💛

## Responses 2

Markdown supported · ⌘↵ to post

[Diddles Code](https://hashnode.com/@diddlescode)

[May 5, 2023](https://hashnode.com/posts/how-to-setup-proxy-in-react-with-http-proxy-middleware/625ae43f2f84e0d4fc33d2d3/comment/6454f87757546b122cde66bb)

does this work when you deploy to production? if yes, are there any changes to be done. I have tried this but when deploying to production, api calls are not being redirected to the correct server.

[Samuel Olagesin](https://hashnode.com/@Olagesin)

[Apr 16, 2022](https://hashnode.com/posts/how-to-setup-proxy-in-react-with-http-proxy-middleware/625ae43f2f84e0d4fc33d2d3/comment/625aefda52fb7bd53380ed7c)

Well-done man!!

[Sunkanmi Fafowora](https://hashnode.com/@SunkanmiFafowora)

[Apr 16, 2022](https://hashnode.com/posts/how-to-setup-proxy-in-react-with-http-proxy-middleware/625ae43f2f84e0d4fc33d2d3/comment/625aefda52fb7bd53380ed7c#reply-625af17b52fb7bd53380edaa)

Thanks, Sam!! 😀 If you encounter the error sha, just know there's a solution right here.
