How to build a simple Google proxy?

1 minute read

In China, we can’t use google, lots of people will set up their VPN. But if we only use Google to search, running a VPN instance is too expensive.

To save money, we can scale up the instance in a fixed period which is not flexible. Is there a VPN instance that will start when we use it and close when we don’t use it?

I thought of using API Gateway + Lambda, but recently I found API Gateway can integrate HTTP, then we could set up a proxy for google.

Let’s see how to do it

  1. Log in to your AWS account and go to the API Gateway service

  2. Click the Build button of HTTP API

    Click Build button

  3. Click Add Integration button

    Click Add Integration button

  4. Input the integration details and click the Next button

    Input integration details

  5. Input the Resource path and click Next

    Input Resource path

  6. Click the Next button Click next directly

  7. Click Create button

    Click create button

  8. Use the Invoke URL to access google

    Invoke Url

    Access Google

    Search Result

That’s it! we don’t need a VPN and just pay for what we used which is very cheap. And if you have a domain in AWS, you can map the custom domain name to the API Gateway endpoint.

The only thing you need to consider is how to do authentication and authorization, options are

  • No authentication and authorization, just use a domain name only known by yourself.
  • API Gateway supported authorization, but you need to find a way to pass the credential in the browser.

Try it and hope you have a fun time!!

Tags:

Updated:

Comments