Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Setting up a proxy server

3035 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Pedro_Botsaris
4 - Data Explorer
4 - Data Explorer

Hi everyone,

This question might sound a bit naive and I apologize in advance. What is the best way to set up a proxy to a backend app in the scripting blocks dev environment?

When using create-react-app I make the proxy in the package.json

"proxy": {
    "/api/projects": {
      "target": "http://localhost:3000"
    }

or more recently using http-proxy-middleware and creating a setupProxy.js on my src folder.

const { createProxyMiddleware } = require(‘http-proxy-middleware’);

module.exports = function (app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: 'http://localhost:3000',
      changeOrigin: true,
    })
  );
};

I am not quite sure to set that when using the blocks. Thanks so much for your help!

3 Replies 3
Ryan_Wilson
4 - Data Explorer
4 - Data Explorer
I'm sorry, but unfortunately, I'm not an expert in coding proxies and using them. I only purchased them already done and verified, and it has been working great for me ever since I started. I was a manager of a great corporation. When Covid started, we had to work from home. It was required to use a VPN, but it would not connect to my Wi-Fi. My friend said I should buy a proxy server. And I did. But it got installed when I paid for it, and I only had to connect it to the network. I can't help you any more than this. However, I hope someone here will. Good luck.
henpapi
4 - Data Explorer
4 - Data Explorer

Generally, you will use a proxy if your school or workplace provides it. You can also use a proxy to hide your IP address or access geo-blocked sites not available in your country.

dixocid
4 - Data Explorer
4 - Data Explorer

Apologies for the delayed response, considering that the thread is a few years old. Proxy setup methods may have evolved since then, so it's worth checking for any updates or changes in the preferred approach.
In general, setting up a proxy in the scripting blocks dev environment would still involve using a reverse proxy server like NGINX or Apache. These servers act as intermediaries, forwarding requests to your backend app. Configuration details may vary, so it's a good idea to consult the documentation or resources specific to the server you choose.
For more information and up-to-date guidance on setting up proxies, you can visit proxys.io. They offer valuable resources and insights into proxy server configurations.