https://github.com/contextualist/proxlet
a POC, naïve implemetation of serverless reverse proxy for any website
https://github.com/contextualist/proxlet
reverse-proxy serverless
Last synced: 10 months ago
JSON representation
a POC, naïve implemetation of serverless reverse proxy for any website
- Host: GitHub
- URL: https://github.com/contextualist/proxlet
- Owner: Contextualist
- Created: 2019-06-03T21:06:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T03:15:11.000Z (almost 7 years ago)
- Last Synced: 2024-05-17T00:27:25.679Z (almost 2 years ago)
- Topics: reverse-proxy, serverless
- Language: Go
- Size: 2.93 KB
- Stars: 25
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxlet
[](https://deploy.now.sh/?repo=https://github.com/Contextualist/proxlet)
Proxlet is a POC, naïve implemetation of serverless reverse proxy for any website.
## Supported Providers
* [Now.sh](https://zeit.co/now)
* [AWS Lambda](https://aws.amazon.com/lambda)
* [Google Cloud Functions](https://cloud.google.com/functions)
### Now.sh
dev dependency: [now-cli](https://github.com/zeit/now-cli#usage)
```bash
now
curl https://{app_name}.now.sh/https://httpbin.org/get
```
### AWS Lambda
dev dependency: [Serverless Framework](https://serverless.com/framework/docs/getting-started/)
```bash
# First customize serverless.yml's fields: provider.role, provider.region, etc.
make aws
# Then go to AWS API Gateway console, Setting, add Binary Media Type "*/*".
# (All contents are base64-encoded and will be decoded by the API Gateway.)
curl https://{id}.execute-api.{region}.amazonaws.com/dev/https://httpbin.org/get
```
CAVEAT: All subsequent requests fail because of they are lack of the stage path `/dev`
### Google Cloud Functions
dev dependency: [gcloud](https://cloud.google.com/sdk/docs/quickstarts)
```bash
make gcf
curl https://{region}-{project-id}.cloudfunctions.net/proxlet/https://httpbin.org/get
```
CAVEAT: All subsequent requests fail because of they are lack of the function path `/proxlet`
## About the Cookie
To get the real host of subsequent request of relative path, Proxlet sets a session cookie `proxlet-host` with the value of real host. The server does not store the cookie.
## Known Issues
* Cross-site requests are not proxied.
* Now.sh and AWS Lambda have an HTTP response size limit of 6MB. For GCF, it's 10MB.
* AWS Lambda's stage path / GCF's function name path makes all subsequent requests impossible *(unless using a custom domain)*.