
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
http-lambda-proxy
Advanced tools
Proxy HTTP requests to AWS Lambda.
Requests format are compatible with the serverless-http
module, allowing developers to run downstream REST/HTTP services inside lambda funtions as well.
npm i http-lambda-proxy
The following examples describe how to use http-lambda-proxy
with restana
:
const lambdaProxy = require('http-lambda-proxy')
const proxy = lambdaProxy({
target: process.env.FUNCTION_NAME,
region: process.env.AWS_REGION
})
const service = require('restana')()
service.all('/*', (req, res) => {
proxy(req, res, req.url, {}))
})
service.start(8080)
In this example, we proxy all http requests on port 8080 to an AWS Lambda.
region *
Set the AWS Region of the target downstream lambda.
target *
AWS Lambda funcion name, version, or alias.
Set to "Tail" to include the execution log in the response. Default: "None"
Specify a version or alias to invoke a published version of the function.
Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.
Function wrapper to AWS Lambda invocation proxy. Allows to overwrite default implementation.
More details on aws-sdk / lambda / invoke
: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property
proxy(
originReq, // http.IncomingMessage
originRes, // http.ServerResponse
req.url, // Request URL
{} // Options described below
)
Called when the remote lambda response is received. If defined, default behavior is overwritten.
Called to rewrite the headers of the response, before them being copied over to the outer response. It must return the new headers object.
MIT
FAQs
Proxy HTTP requests to AWS Lambda
The npm package http-lambda-proxy receives a total of 469 weekly downloads. As such, http-lambda-proxy popularity was classified as not popular.
We found that http-lambda-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.