How to build a simple Google proxy?
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
-
Log in to your AWS account and go to the API Gateway service
-
Click the Build button of HTTP API
-
Click Add Integration button
-
Input the integration details and click the Next button
-
Input the Resource path and click Next
-
Click the Next button
-
Click Create button
-
Use the Invoke URL to access google
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!!
Comments